spring-projects / spring-projects/spring-data-rest
Accessing ManyToOne relations with Spring's RestTemplate (HTTP 400) [DATAREST-476]
@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
Moritz Schulze opened DATAREST-476 and commented
Accessing exported @ManyToOne relationships strangely fails with Spring's RestTemplate with the status code 400 and the message
AbstractRepositoryRestController : Map has no value for 'repository'
So if I have a class Person and a class Address which references Person with @ManyToOne I can't access /addresses/0/person with the RestTemplate.
It works fine with command line curl or Apache's HttpClient. I tried debugging it a bit but have no clue why this is not working. I'm not even sure if SDR is the right project for this bug.
Attached is an example project with three tests that show the behaviour
Affects: 2.2.1 (Evans SR1)
Attachments:
- restbug.zip (4.49 kB)
1 votes, 2 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.