Question

I have a web app with versionned API. In the next version of the API, I want to serialize my joda DateTime object using the ISO format (2013-12-14T00:00:00.000Z) instead of the EPOCH format.

I achieved my goal by using a custom serializer that I coded and adding it to the objectMapper of my jacksonJsonProvider. The problem, the serialization of DateTime object changed for all versions of my API (which is bad, since I don't want any breaking change in the API).

Is there a way to specify to the jersey resource which jacksonJsonProvider to use? (as I said in the title, I am using Guice as my DI framework).

EDIT

I am using version 1.7.1 of Jersey and 4.0-beta of guice

Was it helpful?

Solution

It can be achieved via annotated bindings or better private modules. I need more information from you to help you further, check my comment under your question.

Look at my post how to encapsulate modules. https://stackoverflow.com/a/20073461/2616445

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top