opendatalab-de / geojson-jackson

GeoJson POJOs for Jackson - serialize and deserialize objects with ease
http://blog.opendatalab.de
Apache License 2.0
263 stars 94 forks source link

Prevent Jackson from unwrapping List in Geometry #69

Open Strongbeard opened 2 months ago

Strongbeard commented 2 months ago

When a Geometry containing a single list of LngLatAlt within its coordinates list was serialized using an ObjectMapper with SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED enabled the resulting output no longer matched the examples in RFC7946 due to the array brackets for the coordinates list being omitted. This deviation in expected json format prevents deserialization of the output back to the original Geometry. Preventing this feature from activating on the coordinates list in Geometry, even when enabled in the ObjectMapper, resolves the breaking of the idempotent nature of serialization and deserialization by keeping the output as close to the examples in RFC7946 as possible.

Intended to resolve #68