Closed tomsontom closed 8 years ago
Hey Tom, actually such an API already exist, see com.eclipsesource.jaxrs.provider.gson.GsonProvider.setGson(Gson)
You can request an instance of GsonProvider and set the Gson that is used. It's not the nicest API but it should cover your usecase.
Also another alternative is that you just register your own @Provider. The gson provide delivered is just for convenience.
My current use case is that I want to control how GSON serializes Date-Objects (I want them to be converted to an ISO-DateTime yyyy-MM-ddTHH:mm:ssZ).
I would propose that one can contribute an OSGi-Service who is responsible to create the Gson-Instance - if you'd accept such a contribution I would contribute such an API