Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: DATAREST-34
As mentioned in DATAREST-34 and it's comments, this enhancement enables control of response body negotiation for PUT and POST requests through
the presence of the HTTP Accept header. RepositoryRestConfig.setReturnBodyOnCreate(…) and RepositoryRestConfig.setReturnBodyOnUpdate(…) were converted to Boolean and default to Boolean.FALSE. When set to null, the response body negotiation is controlled by the presence of the Accept header.
For example:
curl -H "Content-Type: application/json" -d '{"id" : "cafebabe","vCenterId" : "cafebabe2","vCenterName" : "nuclab"}' http://localhost:8080/spring-data-rest-test-app-1.0-SNAPSHOT/clients
Returns:
{
"id" : "cafebabe",
"vCenterId" : "cafebabe2",
"vCenterName" : "nuclab",
"_links" : {
"self" : {
"href" : "http://localhost:8080/spring-data-rest-test-app-1.0-SNAPSHOT/clients/cafebabe"
}
}
}
While the following command returns no body:
curl -H "Content-Type: application/json" -H "Accept:" -d '{"id" : "cafebabe2","vCenterId" : "decafbad","vCenterName" : "the decaf lab"}' http://localhost:8080/spring-data-rest-test-app-1.0-SNAPSHOT/clients
I also corrected some of the Javadoc annotations in the RepositoryEntityController class.
I have signed and agree to the terms of the Spring Individual Contributor License Agreement.