resty-gwt / resty-gwt

Like GWT-RPC but with REST/JSON coolness
http://restygwt.fusesource.org/
Apache License 2.0
291 stars 163 forks source link

how to configure objectmapper of jackson #327

Open rakesh-roshan opened 8 years ago

rakesh-roshan commented 8 years ago

I want to configure the ObjectMapper of jackson library like enable wrap_root etc... Is there a way to do this?

blop commented 8 years ago

I've extended com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder and com.github.nmorel.gwtjackson.client.JsonDeserializationContext.Builder.

Then added this : `

</replace-with>
<replace-with class="com.example.CustomJsonDeserializationContextBuilder">
    <when-type-assignable class="com.github.nmorel.gwtjackson.client.JsonDeserializationContext.Builder" />
</replace-with>`

This way I can configure things such as : serializeNulls(false); writeDatesAsTimestamps(false);

blop commented 8 years ago

You should add this to the documentation ;-)