Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.3.0
-
None
-
Unknown
Description
When autoDiscoverObjectMapper is set on JsonDataFormat definition, it is not propagated to JacksonDataFormat. Looking at the code in JsonDataFormatReifier I was not able to see this property in the list of populated properties.
Please see attachment for the reproducer project. ObjectMapperTest demonstrates the issue. In the route builder we set:
json.setAutoDiscoverObjectMapper("true");
but it has no affect, indicated by an exception on Java Time deserialization and a message in logs:
o.a.c.c.jackson.JacksonDataFormat : The option autoDiscoverObjectMapper is set to false, Camel won't search in the registry ... Exhausted after delivery attempt: 1 caught: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time.LocalDate` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2077-01-01')