When search queries from Spring Data repositories result in a single result, the usual headers such as ETag and Last-Modified should be provided.
This is useful when you have crafted a specific search method that will always return exactly one entity and you're using ETags to handle optimistic locking. Currently you have to search for the object and make an additional GET request on its self URI so you can access its ETag
@Oliver Trosien Yes those are the methods I am talking about. In particular anything with a findOne prefix.
I added a link to a pull request, #218, for a modification that my company is using internally to add this functionality. Any feedback would be appreciated
Thanks for the PR Matthew. I've already created a fix locally that includes a bit of a rearrangement of some internal code to improve the situation in general. I am about to close your PR for that reason, but expect that ticket to be fixed soon. I'd like to just apply a bit more polish and am currently traveling conferences
Matthew Borger opened DATAREST-835 and commented
When search queries from Spring Data repositories result in a single result, the usual headers such as ETag and Last-Modified should be provided.
This is useful when you have crafted a specific search method that will always return exactly one entity and you're using ETags to handle optimistic locking. Currently you have to search for the object and make an additional GET request on its self URI so you can access its ETag
Affects: 2.5.1 (Hopper SR1)
Reference URL: #218
Referenced from: commits 50c2197, aa7eec4
Backported to: 2.6 RC1 (Ingalls)
The text was updated successfully, but these errors were encountered: