-
Notifications
You must be signed in to change notification settings - Fork 14
Description
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?