Bind different JacksonJsonProvider to different jersey resources with Guice

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

I achieved my goal using the special serializer that I encoded and adding it to the objectMapper of my jacksonJsonProvider. The problem is that the serialization of the DateTime object has changed for all versions of my API (which is bad since I don't want any changes to the API).

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

EDIT

I am using version 1.7.1 from jersey and 4.0 beta hints

+4
source share
1 answer

This can be achieved with help annotated bindingsor better private modules. I need more information from you to help you, check out my comment on your subject.

See my post on how to encapsulate modules. fooobar.com/questions/1522455 / ...

0
source

All Articles