--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
I couldn't find the serializerProvider.findRootSerializer method, but serializerProvider.findPrimaryPropertySerializer seems to work fine instead.
My code now follows these steps:1. JAX-RS endpoint is called and passed a couple of query params.2. ObjectWriterInjector/ObjectWriterModifier are used to set the query param values as attributes on the ObjectWriter so they can be accessed within the serializers.3. A custom serializer uses the query param values (retrieved from the ObjectWriter) to decide which serializer to use, falling back to the default returned from serializerProvider.findPrimaryPropertySerializer if necessary.Does this seem like a better approach? Any obvious improvements I can make?
Thanks again,Ross
Great, thanks - I'll try to get something written up once I've finished the implementation.One final question (hopefully!)... is there a way to dynamically set a JsonView for a property? Depending on the query params passed to a JAX-RS endpoint I'm either outputting a partial or full representation of an embedded model. At the moment I'm using the customer serializer mentioned above to look up another custom serializer to output the partial representation - JsonViews feel like a better solution, I just can't work out how to dynamically set one for an embedded model depending on the query params passed to the endpoint.
Thanks again for the help, it's much appreciated.Ross