koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
104 stars 32 forks source link

Fix moving object id field to start. #167

Closed ahamilt closed 4 years ago

ahamilt commented 4 years ago

If the object id field was named anything other than OBJECTID it was not being moved to the start of the response fields (instead the last field was being moved to the start). Fixed to pick out the object id based on field type.

rgwozdz commented 4 years ago

CI build is failing. You should run npm test locally and fix the linting and failing tests.

Can you provide an explanation for why this change is necessary?

ahamilt commented 4 years ago

The name of the id field can be provided in the data.metadata.idField property, allowing names other that the default 'OBJECTID'. If this is provided, the code that attempted to make the esriFieldTypeOID field the first field in the response was not working. It was attempting to find a response field with the name 'OBJECTID', which didn't exist. (Instead, it ended up moving the last field to the first position.)

rgwozdz commented 4 years ago

@ahamilt - thanks for the explanation, makes sense. I should be able to review soon.

rgwozdz commented 4 years ago

Released in 2.21.2.