Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3502

The Jackson Provider should add the Jackson Jdk8Module and JavaTimeModule by default

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Providers
    • None

      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.

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: