spring-projects / spring-data-rest

Simplifies building hypermedia-driven REST web services on top of Spring Data repositories
https://spring.io/projects/spring-data-rest
Apache License 2.0
905 stars 558 forks source link

PATCH request for updating nested collections does not work correctly since spring-boot 3.1.1 #2355

Closed kamangacode closed 5 months ago

kamangacode commented 5 months ago

Starting with Spring Boot 3.1.1, the PATCH method no longer works properly. We try to update objects with aggregate collections but the collection is partially updated. I create this project for more explanation and a way to reproduce the issue in both versions 3.1.0 and versions up to 3.1.1: https://github.com/kamangacode/spring-data-rest-ano

Do you have any idea why this happened?

I appreciate your support.

odrotbohm commented 5 months ago

Sounds like a duplicate of #2350. Would you mind trying the latest snapshots?

spring-projects-issues commented 5 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

kamangacode commented 5 months ago

I am sorry what are the requested informations? I gave a fully working project with all explanations to reproduce the issue: https://github.com/kamangacode/spring-data-rest-ano And here is a copy of the readme file from the project: Bug explanation Starting with Spring Boot 3.1.1, the PATCH method is no longer working properly. This project is a minimal example to reproduce the bug. You can see the bug in action by running this command ./gradlew bootRun.

How to reproduce the bug Import the spring-data-rest-ano.postman_collection.json file in Postman. Go to the PATCH request and run it. We try to update the participants field of the programme object. We already have 2 participants and expect to have 4 participants field. But we only have 3 participants field.

How to reproduce normal behavior Go to "build.gradle" and change the Spring Boot version to 3.1.0. Run ./gradlew bootRun and run the PATCH request again. This time, we have 4 participants field as expected.

odrotbohm commented 5 months ago

It looks like you chimed in on #2350. I had filed and fixed #2357 in response. So closing this as duplicate.