spring-projects / spring-projects/spring-data-rest
Problem with updating collection of associated resources
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
In our project we have a few resources, and one of them is aggregating the rest with the OneToMany relations (per each resource). During the creation (POST) of the main resource we're providing the URIs to the associated resources and eveything works fine (providing zero, one or more links).
The issues apear when we try to update the main resource. While using PATCH, we can modify the collections with associations (add, reduce, remove all), but when we're using PUT, no changes are propagated.
We proceeded with using PUT as the only way to update the resources and prior to 4.3.X version we had a really hacky way to achieve the expected result (using a similar request body structure for POST and PUT which updates the collections), but now it doesn't work.
Please have a look on the sample project and let us know if the setup or assumptions are wrong.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.