jasminb / jsonapi-converter

JSONAPI-Converter is a Java/Android library that provides support for working with JSONAPI spec
Apache License 2.0
273 stars 81 forks source link

Configurable Link serialization #229

Open ghost opened 4 years ago

ghost commented 4 years ago

The fix for #182 introduced a simpler, spec compliant way to serialize Link when meta is null. Unfortunately this is also a breaking change with no clean way to override it. Consumers of JSONAPI-Converter can rev their APIs to document this difference, but still need to support older API versions that returned the previous format.

It's possible to override this new behavior by implementing JacksonAnnotationIntrospector and forcing use of the standard serialization mechanism for Link. That said, such a solution isn't particularly clean and couples the consumer to implementation details of this library.

I propose formally supporting this by adding a configuration option for the Link serialization format.

Thanks.