Skip to content

Add missing ObjectMapper#createNonBlockingByteBufferParser() method #5110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sdeleuze opened this issue Apr 25, 2025 · 2 comments
Closed

Add missing ObjectMapper#createNonBlockingByteBufferParser() method #5110

sdeleuze opened this issue Apr 25, 2025 · 2 comments
Labels
3.0 Issue planned for initial 3.0 release

Comments

@sdeleuze
Copy link

sdeleuze commented Apr 25, 2025

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

In Jackson 3, for some reasons, only createNonBlockingByteArrayParser exists in ObjectMapper. Spring also uses createNonBlockingByteBufferParser in its JacksonTokenizer and currently has to write code like:

DeserializationContextExt context = objectMapper._deserializationContext();
JsonParser parser = context.assignAndReturnParser(objectMapper.tokenStreamFactory().createNonBlockingByteBufferParser(context));

Describe the solution you'd like

It would be better to have ObjectMapper#createNonBlockingByteBufferParser to avoid invoking objectMapper._deserializationContext() in production code and have a shorter syntax.

Usage example

JsonParser parser = objectMapper.createNonBlockingByteBufferParser();

Additional context

No response

@sdeleuze sdeleuze added the to-evaluate Issue that has been received but not yet evaluated label Apr 25, 2025
@cowtowncoder
Copy link
Member

Sounds like a clear oversight, thank you for reporting.

@cowtowncoder cowtowncoder changed the title Introduce ObjectMapper#createNonBlockingByteBufferParser Add missing ObjectMapper#createNonBlockingByteBufferParser() method Apr 25, 2025
@cowtowncoder cowtowncoder added 3.0 Issue planned for initial 3.0 release and removed to-evaluate Issue that has been received but not yet evaluated labels Apr 25, 2025
@cowtowncoder
Copy link
Member

Fixed via #5113.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Issue planned for initial 3.0 release
Projects
None yet
Development

No branches or pull requests

2 participants