How to handle "Optimistic Locking" on a collection with ETag headers?

by maximedupre   Last Updated October 04, 2018 23:05 PM

Consider endpoint /projects that returns a list of projects with the following headers:

HTTP/1.1 200 OK
Etag: "superEtag"

The etag value represents a hash of the entire collection and it does not allow a client to update a single resource e.g. /projects/1.

Fetching the resources individually makes no sense, so how can I handle optimistic locking with a collection?

Related Questions

What to do when “Optimistic Locking” doesn't work?

Updated October 05, 2018 18:05 PM

How to handle deadlocks (with a REST API)?

Updated August 27, 2018 16:05 PM