koopjs / winnow

Deprecated
Apache License 2.0
90 stars 18 forks source link

Fix payloads when idField is set #104

Closed rgwozdz closed 5 years ago

rgwozdz commented 5 years ago

This PR removes a workaround (implemented 5 or 6 months ago) that helped get koop working on ArcGIS clients. The workaround added anOBJECTID field to payloads even if a provider had set idField in the provider metadata. The result was two properties with the same value. This is not ideal, for reasons noted in https://github.com/koopjs/FeatureServer/issues/127.

I've identified the original bug - it was in queries that had returnIdsOnly=true. When that parameter was set, outFields were forced to OBJECTID even if idField had been set in the provider. That bug is fixed and the workaround is not removed. If idField is set a duplicate property OBJECTID is no longer added.

I've added some test coverage for the normalization functions that were added or modified.

NOTE: there will be a companion PR on FeatureServer required to make this fix effective on koop deployments.