Class JacksonJsonMapperConfigurator

java.lang.Object
org.camunda.bpm.engine.rest.mapper.JacksonJsonMapperConfigurator
All Implemented Interfaces:
jakarta.ws.rs.ext.ContextResolver<tools.jackson.databind.json.JsonMapper>

@Provider @Produces({"application/json","application/hal+json"}) public class JacksonJsonMapperConfigurator extends Object implements jakarta.ws.rs.ext.ContextResolver<tools.jackson.databind.json.JsonMapper>
Jackson 3 specific ContextResolver that exposes the configured mapper under the concrete JsonMapper type.

Background: Jackson 3's tools.jackson.jakarta.rs.json.JacksonJsonProvider extends ProviderBase<..., JsonMapper, ...> and, when resolving the mapper to use for (de)serialization, asks the JAX-RS runtime for a ContextResolver<JsonMapper>. A ContextResolver<ObjectMapper> (as provided by JacksonConfigurator for the engine-rest application code) is not matched for that request, which would leave the provider using its UTC-defaulted mapper and break wire compatibility with the Jackson 2 module.

This resolver therefore mirrors JacksonConfigurator but is parameterized with JsonMapper, ensuring the provider picks up the very same configured mapper (date format, timezone, property ordering) as the application code.

  • Constructor Details

    • JacksonJsonMapperConfigurator

      public JacksonJsonMapperConfigurator()
  • Method Details

    • getContext

      public tools.jackson.databind.json.JsonMapper getContext(Class<?> clazz)
      Specified by:
      getContext in interface jakarta.ws.rs.ext.ContextResolver<tools.jackson.databind.json.JsonMapper>