Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Configure ObjectMapper in JaxRS Whiteboard application
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
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.