You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by panzerhans <es...@tjonneland.no> on 2014/10/23 15:18:50 UTC

REST marshal gson with custom Exclustion Strategy

I am struggling to wrap my head around how to create a Gson ExclusionStrategy
that depends on a value in the Message object from the Exchange (this is
stored in a Header).

I am registering restConfiguration().setJsonDataFormat("json-gson") in my
route definition (so Google Gson is being used for marshalling).

How do I now go about for registering the Exclusion strategies in the route
for the GsonDataFormat type used by Camel?




--
View this message in context: http://camel.465427.n5.nabble.com/REST-marshal-gson-with-custom-Exclustion-Strategy-tp5757941.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: REST marshal gson with custom Exclustion Strategy

Posted by panzerhans <es...@tjonneland.no>.
I am going to answer this one myself. As it is you cannot use content from
the Exchange message to manipulate the Gson marshalling. At least not using
the built in GsonDataFormat. You need to roll your own dataformat and use
that. I guess that is fair enough :)



--
View this message in context: http://camel.465427.n5.nabble.com/REST-marshal-gson-with-custom-Exclustion-Strategy-tp5757941p5757980.html
Sent from the Camel - Users mailing list archive at Nabble.com.