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

Regression fix for #4741 Include.NON_DEFAULT setting used on POJO, empty values are not included in json if default is null #4744

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

JooHyukKim
Copy link
Member

demonstrates "possible" solution that resolves #4741

Fix and test

Delete GoodTest.java
@JooHyukKim JooHyukKim marked this pull request as draft October 10, 2024 11:09
@JooHyukKim JooHyukKim changed the title [DRAFT] Regression fix for 4741 Regression fix for 4741 Oct 10, 2024
@JooHyukKim JooHyukKim changed the title Regression fix for 4741 Regression fix for #4741 Include.NON_DEFAULT setting used on POJO, empty values are not included in json if default is null Oct 11, 2024
@JooHyukKim JooHyukKim marked this pull request as ready for review October 11, 2024 01:49
valueToSuppress = BeanPropertyWriter.MARKER_FOR_EMPTY;
// [databind#4471] Different behavior when Include.NON_DEFAULT
// setting is used on POJO vs global setting, as per documentation.
if (!_useRealPropertyDefaults) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of re-checking configuration settings, let's rely on "_useRealPropertyDefaults" which means that POJO settings are in use (not global-, per-type or property)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense 👌🏼

@cowtowncoder
Copy link
Member

@JooHyukKim I figured out a simpler check which I think works. But wanted to ask WDYT before merging. All tests pass which is good.

@JooHyukKim
Copy link
Member Author

I like the simpler check 🙏🏼 LGTM! @cowtowncoder

@cowtowncoder
Copy link
Member

@JooHyukKim Thank you for taking a lead on this! I'll go ahead and merge soon.

@cowtowncoder cowtowncoder merged commit 3da3da8 into FasterXML:2.18 Oct 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants