Regarding id:
spring-data-rest hides the id by default and tries to communicate only with links to resources. It tries to apply the principles of HATEAOS - http://docs.spring.io/spring-data/rest/docs/current/reference/html/#conditional.etag
Regarding version:
If you have a version specified in your entity (I only have spring-data-jdbc background) spring-data-rest will report the version in the response in the ETag Header.
If you e.g. issue a patch and want to make sure the version you update is still up-to-date with what your read before you can use the ETag
you received in the If-Match
header. If the version is no longer up-to-date you receive a 412 Precondition Failed
So here is my request flow:
//get a product
http :8080/products/2 -v
Response:
HTTP/1.1 200 OK
ETag: "2"
The patch request would look like this
http PATCH :8080/products/2 name=some3 If-Match:2 -v
Request:
PATCH /products/2 HTTP/1.1
Accept: application/json
Content-Type: application/json
If-Match: 1
Response:
HTTP/1.1 412 Precondition Failed
ETag: "3"
You will find details in the spring-data-rest documentation:
http://docs.spring.io/spring-data/rest/docs/current/reference/html/#conditional.etag