Skip to content
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

Add JsonMapper.builderWithJackson2Defaults() #5004

Merged
merged 6 commits into from
Mar 6, 2025

Conversation

pjfanning
Copy link
Member

@pjfanning pjfanning added the 3.0 Issue planned for initial 3.0 release label Mar 5, 2025
{
ObjectMapper mapper = JsonMapper.builderWithJackson2Defaults().build();
JsonFactory jsonFactory = (JsonFactory) mapper.tokenStreamFactory();
assertFalse(mapper.isEnabled(StreamReadFeature.USE_FAST_DOUBLE_PARSER));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also not verify streaming-level setting at databind level.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People who want max Jackson2 compatibility will want mapper and factory level Jackson2-like config.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it must be done at correct level -- streaming at streaming, databind at databind. Not with overlap.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JsonMapper.builderWithJackson2Defaults() is a high level method that creates a factory for you.

I have modified the lower level configureForJackson2 methods not to set factory level configs.

@cowtowncoder cowtowncoder merged commit b1b7a17 into FasterXML:master Mar 6, 2025
6 checks passed
@cowtowncoder cowtowncoder changed the title add JsonMapper builderWithJackson2Defaults() Add JsonMapper builderWithJackson2Defaults() Mar 6, 2025
@cowtowncoder cowtowncoder changed the title Add JsonMapper builderWithJackson2Defaults() Add JsonMapper.builderWithJackson2Defaults() Mar 6, 2025
@pjfanning pjfanning deleted the jackson2-like branch March 7, 2025 19:11
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

Successfully merging this pull request may close these issues.

2 participants