Skip to content

Fixing records deserialization issue when JsonIgnore is used with same json property name #5089

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

Merged

Conversation

iifawzi
Copy link
Contributor

@iifawzi iifawzi commented Apr 10, 2025

Hey, following up on #5073, this PR resolves the second issue reported at #4628.
With this change, we will not attempt to rename any properties to be ignored, this way the field will not be removed from the ignorable list here.

if (_replaceCreatorProperty(_creatorProperties, prop)) {
// [databind#2001]: New name of property was ignored previously? Remove from ignored
// 01-May-2018, tatu: I have a feeling this will need to be revisited at some point,
// to avoid removing some types of removals, possibly. But will do for now.
// 16-May-2020, tatu: ... and so the day came, [databind#2118] failed
// when explicit rename added to ignorals (for READ_ONLY) was suddenly
// removed from ignoral list. So, added a guard statement above so that
// ignoral is ONLY removed if there was matching creator property.
//
// Chances are this is not the last tweak we need but... that bridge then etc
if (_ignoredPropertyNames != null) {
_ignoredPropertyNames.remove(name);
}

which can be finally excluded during deserialization.

@cowtowncoder cowtowncoder merged commit 15d0309 into FasterXML:2.18 Apr 11, 2025
7 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