Message Boards

Configure ObjectMapper in JaxRS Whiteboard application

thumbnail
Andre Albert, modified 3 Years ago.

Configure ObjectMapper in JaxRS Whiteboard application

New Member Posts: 13 Join Date: 3/28/14 Recent Posts

We are currently migration a 7.1 jaxrs application to 7.3 DXP. 

Previously, we add JacksonJsonProvider to our getSingletons() result to enable a pre-configured Jackson-JSON mapping. But using this in Liferay 7.3 our preconfigurations of the mapper are not applied. Even, if we dont not add the JacksonJsonProvier the object serialization still works, so i guess there is a default object mapper somewhere applied (in 7.1 we got the no-MessageBodyWriter exceptions in that case).

How can we adjust the default Jackson provider in out application? The aim is to replace the LocalDate Serializer to serialize dates to [yyyy, mm, dd] array

Many thanks and greetings

Andre

thumbnail
Andre Albert, modified 2 Years ago.

RE: Configure ObjectMapper in JaxRS Whiteboard application

New Member Posts: 13 Join Date: 3/28/14 Recent Posts

Ok, i realized that there was a osgi config file org.apache.aries.jax.rs.jackson.config existent, that automatically enables jackson objectmapper. This was the reason of my getSingletons ignored JsonProviders.

Still, i am wondering who to configure the default json-provider (if used). But this is not critical for me anymore.