Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-28377

[GSS](8.0.z) RESTEASY-3502 - The Jackson Provider should add the Jackson Jdk8Module and JavaTimeModule by default

XMLWordPrintable

      Currently the Jackson provider does not include the Jdk8Module, JavaTimeModule and JakartaXmlBindAnnotationModule to the ObjectMapper by default. In some cases this is not an issue because older versions of Jackson will serialize objects. However, the serialized result could be considered odd. For example when serializing a java.util.Optional without the Jdk8Module results in:

      {"empty":false,"present":true}
      

      The value itself would be rendered if the module is present.

      In newer releases of Jackson without the Jdk8Module an exception would be thrown. This may be related tohttps://github.com/FasterXML/jackson-modules-java8/issues/294.

      While this behavior should not be back ported to 6.2, it seems reasonable to include in 7.0 as it's not yet final. User should still be able to override a ObjectMapper provider. It is likely a good idea to simply use the new ObjectMapper().findAndRegisterModules() by default.

      Note that when integrated into WildFly we will need to update the documentation https://docs.wildfly.org/32/Developer_Guide.html#custom-objectmapper.

              rhn-support-ivassile Ilia Vassilev
              rhn-support-bmaxwell Brad Maxwell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: