Skip to content

Improve support for deserializing from TokenBuffer (f.ex for content buffered for non-blocking parsing) #5111

@sdeleuze

Description

@sdeleuze

Is your feature request related to a problem? Please describe.

With Jackson 3, in order to support customer deserializers (specified with @JsonDeserialize(using = Deserializer.class)) with non-blocking parsing, Spring has to do mapper.readerFor(javaType).readValue(tokenBuffer.asParser(mapper._deserializationContext())) in its AbstractJacksonDecoder.

We introduced this using Jackson 2 via spring-projects/spring-framework#20526, but with Jackson 3 that's not ideal given the fact that ObjectMapper#_deserializationContext() is advertised as "only public to allow for testing".

With just mapper.readerFor(javaType).readValue(tokenBuffer.asParser()) we get an UnsupportedOperationException with "Operation not supported by ObjectReadContext of type tools.jackson.core.ObjectReadContext$Base".

Describe the solution you'd like

We would like that Jackson 3 offers a way to do non-blocking parsing of instance of classes with customer deserializers without having to invoke a test-related method.

Usage example

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions