-
Notifications
You must be signed in to change notification settings - Fork 562
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 on PATCH requests when dealing with OneToMany link #2287
Comments
same here 😐️ |
same for me! |
same for us. we recently tried to update to spring-boot version 2.7.14 but nothiced this regression, so we reverted back to our old version. |
The removal of manual collection value appendance for primitives in the context of GH-2261 lead to complex object to be appended onto a collection not being deserialized at all. This deserialization is now reinstantiated with the value to be added looked up by reading the parent node into the collections element type using a JSON Pointer expression of /$propertyName/$index. This is done to make sure that @JsonDeserialize annotations on the property kick in for the deserialization of the individual elements. We now also shortcut the entire merge algorithm for collections that are empty, contain primitives or enums. Fixes GH-2287.
The removal of manual collection value appendance for primitives in the context of GH-2261 lead to complex object to be appended onto a collection not being deserialized at all. This deserialization is now reinstantiated with the value to be added looked up by reading the parent node into the collections element type using a JSON Pointer expression of /$propertyName/$index. This is done to make sure that @JsonDeserialize annotations on the property kick in for the deserialization of the individual elements. We now also shortcut the entire merge algorithm for collections that are empty, contain primitives or enums. Fixes GH-2287.
The removal of manual collection value appendance for primitives in the context of GH-2261 lead to complex object to be appended onto a collection not being deserialized at all. This deserialization is now reinstantiated with the value to be added looked up by reading the parent node into the collections element type using a JSON Pointer expression of /$propertyName/$index. This is done to make sure that @JsonDeserialize annotations on the property kick in for the deserialization of the individual elements. We now also shortcut the entire merge algorithm for collections that are empty, contain primitives or enums. Fixes GH-2287.
This should be in place with the latest snapshots. The tests in the sample project provided by @UglyBarnacle are back to green with those. |
We noticed some regression in 4.1.1 on how on PATCH requests update OneToMany links on an entity.
Given an Invoice in the database containing only 1 invoiceLine, if I execute the following PATCH request to update this invoice (including 2 invoiceLines in the payload), the request will return a 200 but only 1 invoiceLine will be updated.
This is due to the following commit d6d8c50 for issue #2261
This worked fine in 4.1.0 as the break didn't occur there.
I noticed in the issue the following comment :
We now completely skip handling additional values as they don't need to be merged anyway.
Is this the semantics on how a PATCH should work with OneToManyCollections ?
I was under the impression that the PATCH method should update the invoiceLines accordingly, and we should end up with 2 invoicelines after this PATCH.
The text was updated successfully, but these errors were encountered: