spring-projects / spring-projects/spring-data-rest
Spring Data REST association resource always returns HTTP status 204 even if entity being linked is invalid [DATAREST-1296]
@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
Alegria Aclan opened DATAREST-1296 and commented
Actual Behavior:
Doing the ff invalid requests always returns HTTP 204 status
- invalid text
curl -X PUT -H "Content-Type: text/uri-list" -d "invalid text" http://localhost:8080/persons/1/addresses
- empty payload
curl -X PUT -H "Content-Type: text/uri-list" http://localhost:8080/persons/1/addresses
- valid resource url but not referencing a specific entity
curl -X PUT -H "Content-Type: text/uri-list" -d "``http://localhost:8080/addresses``" http://localhost:8080/persons/1/addresses
- invalid resource url
curl -X PUT -H "Content-Type: text/uri-list" -d "``http://localhost:8080/addresses/nonexistingid``" http://localhost:8080/persons/1/addresses
Expected Behavior:
Must return HTTP 400 error instead
1 votes, 1 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.