Class CamundaJacksonJsonProvider

java.lang.Object
tools.jackson.jakarta.rs.base.ProviderBase<tools.jackson.jakarta.rs.json.JacksonJsonProvider,tools.jackson.databind.json.JsonMapper,tools.jackson.jakarta.rs.json.JsonEndpointConfig,tools.jackson.jakarta.rs.json.JsonMapperConfigurator>
tools.jackson.jakarta.rs.json.JacksonJsonProvider
org.camunda.bpm.engine.rest.mapper.CamundaJacksonJsonProvider
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Object>, jakarta.ws.rs.ext.MessageBodyWriter<Object>, tools.jackson.core.Versioned

@Provider @Consumes("*/*") @Produces({"application/json","text/json","*/*"}) public class CamundaJacksonJsonProvider extends tools.jackson.jakarta.rs.json.JacksonJsonProvider
Camunda variant of the Jackson 3 Jakarta-RS JSON provider that restores the empty-body handling the engine-rest resources rely on.

Background: for requests without an entity body, RESTEasy passes a null InputStream to MessageBodyReader#readFrom. Jackson 3's ProviderBase#_createParser forwards that stream straight to ObjectReader.createParser(InputStream), which rejects a null argument with an IllegalArgumentException ("argument \"src\" is null"). That surfaces to the client as an HTTP 500 instead of the graceful null entity the Jackson 2 provider produced.

By returning null from _createParser when the stream is null, the surrounding readFrom logic takes its empty-input branch. With JakartaRSFeature.ALLOW_EMPTY_INPUT enabled by default, this yields a null entity — exactly the Jackson 2 behaviour the engine-rest resources (e.g. redeploy, set job retries) expect when no request body is provided.

  • Field Summary

    Fields inherited from class tools.jackson.jakarta.rs.json.JacksonJsonProvider

    _jsonpFunctionName, _providers, MIME_JAVASCRIPT, MIME_JAVASCRIPT_MS

    Fields inherited from class tools.jackson.jakarta.rs.base.ProviderBase

    _cfgCustomUntouchables, _defaultReadView, _defaultWriteView, _jakartaRSFeatures, _mapperConfig, _readers, _unreadableClasses, _untouchables, _unwritableClasses, _writers, DEFAULT_UNREADABLES, DEFAULT_UNTOUCHABLES, DEFAULT_UNWRITABLES, HEADER_CONTENT_TYPE_OPTIONS, JAKARTA_RS_FEATURE_DEFAULTS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected tools.jackson.core.JsonParser
    _createParser(tools.jackson.databind.ObjectReader reader, InputStream rawStream)
     

    Methods inherited from class tools.jackson.jakarta.rs.json.JacksonJsonProvider

    _configForReading, _configForWriting, _locateMapperViaProvider, hasMatchingMediaType, setJSONPFunctionName, version

    Methods inherited from class tools.jackson.jakarta.rs.base.ProviderBase

    _addSuperTypes, _configForReading, _configForWriting, _containedIn, _createGenerator, _createNoContentException, _endpointForReading, _endpointForWriting, _findCustomUntouchable, _isIgnorableForReading, _isIgnorableForWriting, _isSpecialReadable, _modifyHeaders, addUntouchable, configure, configure, configure, disable, disable, disable, disable, enable, enable, enable, enable, findEncoding, findSuperTypes, findSuperTypes, getSize, hasMatchingMediaTypeForReading, hasMatchingMediaTypeForWriting, isEnabled, isReadable, isWriteable, locateMapper, readFrom, removeUntouchable, setAnnotationsToUse, setDefaultReadView, setDefaultView, setDefaultWriteView, setMapper, writeTo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CamundaJacksonJsonProvider

      public CamundaJacksonJsonProvider()
  • Method Details

    • _createParser

      protected tools.jackson.core.JsonParser _createParser(tools.jackson.databind.ObjectReader reader, InputStream rawStream) throws tools.jackson.core.JacksonException
      Overrides:
      _createParser in class tools.jackson.jakarta.rs.base.ProviderBase<tools.jackson.jakarta.rs.json.JacksonJsonProvider,tools.jackson.databind.json.JsonMapper,tools.jackson.jakarta.rs.json.JsonEndpointConfig,tools.jackson.jakarta.rs.json.JsonMapperConfigurator>
      Throws:
      tools.jackson.core.JacksonException