spring-projects / spring-projects/spring-data-rest

Changing the Relation of an unmanaged unexposed Entity via PATCH is not possible in 4.2.7

Open
#2,410 1 comment 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Aug 12, 2024.

status: waiting-for-triage
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Example project to be found here: https://github.com/HannesRakete/spring-data-rest-patch

In spring boot 3.2.7 it is possible, to modify the relation of an unexposed Entity with PATCH on the spring data rest controller for the parent Entity. Same PATCH request in 3.3.2 returns 2xx but does not change the relation.

In an entity-graph, with 3 entities and the "middle" one not being exposed by spring data rest, it is now not possible any more, to change the relation to another entity.

Rough ERD: SchoolClass -1---n- Pupil -n---1- Course

SchoolClass and Course are exposed via spring data rest, Pupil is not. We did not find a way to manage the relationship between Pupil and Course through the spring data rest endpoint for SchoolClass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.