-
-
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
@JsonBackReference
property is always ignored when deserializing since 2.9.0
#1878
Comments
PR contains a unit test and a fix. |
Hmmh. Perhaps there is some misunderstanding here, but property annotated with But I'll think about this a bit, and see what changed: code for removing property did not seem to change. |
Ok. So 2.8 code was wrong, trying to use reference-name which is not what intent was. So removal was useless; it should never match, and if it ever did that'd be accidental. Then again since there are no unit tests to verify behavior either way removal does not seem like something important for solving a problem or supporting a use case. So... I am bit torn here. I think usage of explicitly setting back reference from JSON is bit wrong. Let me think this over: I may accept the patch, but just comment out removal part (without changing name used for removal). |
@JsonBackReference
property is always ignored when deserializing since 2.9.0
As per above thoughts, I conditionally include the change for 2.9.4. I am little bit concerned there might be cases for which original removal was intended, but let's hope my concerns are unfounded. |
We recently moved from Jackson 2.8.x to 2.9.0.
Since then we started to experiment a new problematic behaviour.
Now a property annotated with
@JsonBackReference
is NEVER deserialized, while before it was sometimes the case.I think it is linked to e088920.
The property is removed in
BeanDeserializerBuilder#addBackReferenceProperty()
:Since 2.9.x (tested on 2.9.0 and 2.9.3),
BeanDeserializerFactory.addBackReferenceProperties
passes aSettableBeanProperty
named as the annotated property.In 2.8.x, the
prop.getName()
returnsdefaultReference
.Because of that, the property is always removed from the property map.
I am creating a PR with at least unit test to reproduce.
The text was updated successfully, but these errors were encountered: