You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really really like this approach to HAL generation and have been playing with it in a RESTEasy/JAX-RS environment to good results so far.
However, I also really like using the some of the jackson serialization annotations and mixins on my domain entities (or DTOs) to do things like order the properties, ellide properties and apply a naming strategy.
Unfortunately, the design of AbstractResourceFactoryStrategy which walks the inheritance hierarchy of the object used to create the resource, copying fields into it's internal map breaks all of that. Jackson never sees my class to apply the mixins or annotations to and never sees any class (just a map of <String,Object>) to apply naming strategy to.
I half wonder if preserving the object given to create the resource in the AbstractResourceFactoryStrategy's map couldnt be possible? I suspect it would break being able to have embeded resources but not sure.
I wouldnt be opposed to having my DTOs implement some ResourceEmbedding interface where the impl is expected to have a member to hold embedded resources in and then HyperExpress can populate it based on the relationship config as it walks the hierarchy. This way my type can be preserved for normal jackson serialization annotations to be processed?
Any other thoughts on how we can continue to use jackson serialization annotations and mixins with HyperExpress?
The text was updated successfully, but these errors were encountered:
Perhaps the AbstractResource could be just a wrapper (instead of essentially a Map), referencing the object instead of copying it. The downside is that since the Resource would hold that object as a Reference, modifying the referenced object would change the resource.
Either that, or we could maybe leverage the Jackson serializer to populate the Resource instead of simply copying every property.
I really really like this approach to HAL generation and have been playing with it in a RESTEasy/JAX-RS environment to good results so far.
However, I also really like using the some of the jackson serialization annotations and mixins on my domain entities (or DTOs) to do things like order the properties, ellide properties and apply a naming strategy.
Unfortunately, the design of AbstractResourceFactoryStrategy which walks the inheritance hierarchy of the object used to create the resource, copying fields into it's internal map breaks all of that. Jackson never sees my class to apply the mixins or annotations to and never sees any class (just a map of <String,Object>) to apply naming strategy to.
I half wonder if preserving the object given to create the resource in the AbstractResourceFactoryStrategy's map couldnt be possible? I suspect it would break being able to have embeded resources but not sure.
I wouldnt be opposed to having my DTOs implement some ResourceEmbedding interface where the impl is expected to have a member to hold embedded resources in and then HyperExpress can populate it based on the relationship config as it walks the hierarchy. This way my type can be preserved for normal jackson serialization annotations to be processed?
Any other thoughts on how we can continue to use jackson serialization annotations and mixins with HyperExpress?
The text was updated successfully, but these errors were encountered: