spring-projects / spring-projects/spring-data-rest
One to Many not save link array [DATAREST-1297]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
sante85 opened DATAREST-1297 and commented
Steps to reproduce:
- Create entity with the following relation:
@OneToMany(mappedBy = "swimmingpoolImplant")
private Set<ConduitSwimmingpool> conduits = new HashSet<>();
-
Create PagingAndSortingRepository for the entity
-
Send PUT on relation request to update the entity (add relation item with 'Id' : 194):{
"http://192.168.1.220:82/HF/conduits/194"
}
- Read entity with GET (to see what is the current state of the entity)
expected: {
"id": 242,
"_embedded": {
"conduitSwimmingpools": [
"http://192.168.1.220:82/HF/conduits/194"
]
},
"_links": {
"self": {
"href": "http://192.168.1.220:82/HF/swimmingpoolImplants/242/conduits"
}
}
actual:
"id": 242,
"_embedded": {
"conduitSwimmingpools": []
},
"_links": {
"self": {
"href": "http://192.168.1.220:82/HF/swimmingpoolImplants/242/conduits"
}
}
Affects: 3.0.11 (Kay SR11)
Attachments:
- 1_ put link.png (389.54 kB)
- 2_put link.png (418.42 kB)
- 3_put link.png (394.90 kB)
- 4_put link.png (397.16 kB)
- get after put.png (324.75 kB)
- get after put 2.png (389.69 kB)
2 votes, 4 watchers
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.