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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontools.jackson.databind.json.JsonMappergetContext(Class<?> clazz)
-
Constructor Details
-
JacksonJsonMapperConfigurator
public JacksonJsonMapperConfigurator()
-
-
Method Details
-
getContext
- Specified by:
getContextin interfacejakarta.ws.rs.ext.ContextResolver<tools.jackson.databind.json.JsonMapper>
-