-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Incorrect deserialization of inner object when using @JsonUnwrapped
, with duplicate property
#1176
Comments
What would the expected behavior here be, in case of duplicates? |
I have tried to mark Root.getEntity() and Root.setEntity() as @JsonIgnor to prevent duplicates and it helped on serialize, so I expect to skip it on deserialize. |
@Sild So you would expect child property I just wanted to verify that I understand expected behavior correctly, thank you for clarification. |
@cowtowncoder Yes,
That's exactly what I want. One more, |
@Sild by having methods |
@cowtowncoder Thanks for your explanation. Then let's focus on @JsonIgnore annotation in Parent object and its expected behaviour during serialize\deserialize. |
@JsonUnwrapped
, with duplicate property
I suggest that there is a bug, if I define the same names for getters\setters name in Child and Root classes.
I have try to use @JsonIgnore on Root getters\setters to prevent double-serialize, but always get null in child object.
Example of my issue: https://github.com/Sild/jackson-deserialize-test/
We get null in Child.entity. But if we rename Root.getEntity() and Root.setEntity() method (to getChildEntity, for example), we get correct Child.entity value
The text was updated successfully, but these errors were encountered: