-
Notifications
You must be signed in to change notification settings - Fork 562
PUT nulls Json read-only property [DATAREST-1006] #1369
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
Comments
Mathias D commented This issue is related to FasterXML/jackson-databind#935 This is fixed with jackson-databind 2.8.7-SNAPSHOT (2.8.7 not yet released) Still I had to add handling of ignored fields to It seems that fields annotated with I added another branch to show the solution that can be applied once jackson-databind 2.8.7 is released and spring-data-rest references it. |
Mathias D commented A workaround that solved it for me is using |
Mathias D commented Just saw that we have Jackson 2.8.8 now. I will update my PR accordingly |
Oliver Drotbohm commented Is there any fix needed at all? You original comment implied it would be fixed with a plain Jackson upgrade, which is why I was basically waiting for its release. Happy to look into what's needed to be done in case there is something |
Mathias D commented I had to skip ignored properties in Please see my commit - it contains a test to reproduce the issue. The test is still red on the current master |
Oliver Drotbohm commented I'll have a look, thanks |
Oliver Drotbohm commented That's merged. Feel free to give the snapshots a try |
Michael S commented Thanks guys. I stumbled upon a related, but different bug that lets PATCH requests override read-only properties just today: DATAREST-1144 |
Mathias D opened DATAREST-1006 and commented
Moving to spring data rest Ingalls GA introduces a new problem regarding read only json properties.
We use
@JsonProperty(access = READ_ONLY)
to mark fields as read-only in our entities. So this field should be serialized but not deserialized.With Ingalls a PUT request nulls such a property.
I think in a PUT should treat
@JsonProperty(access = READ_ONLY)
just as@JsonIgnore
- so such properts is just ignored in a PUT.I have added a test on my fork to reproduce the case: mduesterhoeft@c46df6e
Affects: 2.6 GA (Ingalls)
Backported to: 3.0.1 (Kay SR1), 2.6.8 (Ingalls SR8)
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: