benoitdm-oslandia / pg_featureserv

Apache License 2.0
1 stars 0 forks source link

Bug - unable to PATCH a feature without properties #169

Closed benoitdm-oslandia closed 1 year ago

benoitdm-oslandia commented 1 year ago

from handler_db_update_test.go, remove the properties block:

func (t *DbTests) TestUpdateSimpleFeatureDb() {
    t.Test.Run("TestUpdateSimpleFeatureDb", func(t *testing.T) {
        path := "/collections/mock_a/items/2"
        var header = make(http.Header)
        header.Add("Content-Type", api.ContentTypeSchemaPatchJSON)

        jsonStr := `{
            "type": "Feature",
            "id": "2",
            "geometry": {
                "type": "Point",
                "coordinates": [
                -120,
                40
                ]
            }
        }`

The test fail:

test_http.go:125: handler returned wrong status code for url '/collections/mock_a/items/2'.
    Caused by: Error: Unable to update feature in Collection: mock_a
    Caused by: ERROR: syntax error at or near "," (SQLSTATE 42601)
 - expected: 204; got: 500