spring-bootspring-data-jpaspring-data-rest

PATCH Spring Data Rest not working as expected


I can't share specific code snippets from my current application, but the structure mainly consists of Entities and Repository classes.

We're encountering an issue with the PATCH method. The expected behavior is that it will partially update only the fields present in the request body. However, we're seeing that if some fields in the request body are omitted, those fields in child entities are being set to NULL.

This isn't the desired behavior, as we want to perform partial updates—fields that are not included in the request should retain their existing values and not be updated to NULL. How can we resolve this to ensure that only the fields in the request body are updated?

We have tried transferring to another domain with same configuration, but it works fine as expected.


Solution

  • This issue occurred after upgrading Spring Boot from 3.2.x to 3.3.x.