Skip to content

Commit

Permalink
Reference JSON Format for ETag representation
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Sep 5, 2024
1 parent a79ab2d commit 3414a50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ <h4 id="11411-use-of-etags-for-avoiding-update-conflicts"><a name="UseofETagsfor
<p>Each entity has its own ETag value that MUST change when structural properties or links from that entity have changed. In addition, modifying, adding, or deleting a contained entity MAY change the ETag of the parent entity.</p>
<p>Collections of entities (including collections of related entities) MAY have their own ETag value whose semantics is service-specific. It typically changes if entities are added to or removed from the collection, or if an entity in the collection is changed. The ETag of a collection of related entities reached via a navigation property MAY differ from the ETag of the entity containing the navigation property.</p>
<p>A <a href="#DataModification">Data Modification Request</a> on an existing resource or an <a href="#Actions">Action Request</a> invoking an action bound to an existing resource MAY require optimistic concurrency control. Services SHOULD announce this via annotations with the terms <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency"><code>Core.OptimisticConcurrency</code></a> in <a href="#ODataVocCore">OData-VocCore</a> and <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#NavigationRestrictions"><code>Capabilities.NavigationRestrictions</code></a> (nested property <code>OptimisticConcurrencyControl</code>) in <a href="#ODataVocCap">OData-VocCap</a>.</p>
<p>If optimistic concurrency control is required for a resource, the service MUST include an <a href="#HeaderETag"><code>ETag</code></a> header in a response to a <code>GET</code> request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource.</p>
<p>If optimistic concurrency control is required for a resource, the service MUST include an <a href="#HeaderETag"><code>ETag</code></a> header in a response to a <code>GET</code> request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource, see for example <a href="#ODataJSON">OData-JSON</a>, section “Control Information: <code>etag</code> (<code>odata.etag</code>)”.</p>
<p>The presence of an <a href="#HeaderETag"><code>ETag</code></a> header in a response does not imply in itself that the resource requires optimistic concurrency control; the ETag may just be used for caching and/or conditional <code>GET</code> requests.</p>
<p>If an ETag value is specified in an <a href="#HeaderIfMatch"><code>If-Match</code></a> or <a href="#HeaderIfNoneMatch"><code>If-None-Match</code></a> header of a <a href="#DataModification">Data Modification Request</a> or <a href="#Actions">Action Request</a>, the operation MUST only be invoked if the <code>If-Match</code> or <code>If-None-Match</code> condition is satisfied.</p>
<p>If the client does not specify an <a href="#HeaderIfMatch"><code>If-Match</code></a> request header in a <a href="#DataModification">Data Modification Request</a> or <a href="#Actions">Action Request</a> on a resource that requires optimistic concurrency control, the service responds with a <code>428 Precondition Required</code> and MUST ensure that no observable change occurs as a result of the request. Clients can attempt to disable optimistic concurrency control by specifying <code>If-Match</code> with a value of <code>*</code>. Services MAY reject such requests.</p>
Expand Down
3 changes: 2 additions & 1 deletion docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -4047,7 +4047,8 @@ announce this via annotations with the terms
If optimistic concurrency control is required for a resource, the
service MUST include an [`ETag`](#HeaderETag) header in a response to a
`GET` request to the resource, and MAY include the ETag in a
format-specific manner in responses containing that resource.
format-specific manner in responses containing that resource,
see for example [OData-JSON](#ODataJSON), section "Control Information: `etag` (`odata.etag`)".

The presence of an [`ETag`](#HeaderETag) header in a response does not
imply in itself that the resource requires optimistic concurrency
Expand Down
3 changes: 2 additions & 1 deletion odata-protocol/11.4 Data Modification.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ announce this via annotations with the terms
If optimistic concurrency control is required for a resource, the
service MUST include an [`ETag`](#HeaderETag) header in a response to a
`GET` request to the resource, and MAY include the ETag in a
format-specific manner in responses containing that resource.
format-specific manner in responses containing that resource,
see for example [OData-JSON](#ODataJSON), section "Control Information: `etag` (`odata.etag`)".

The presence of an [`ETag`](#HeaderETag) header in a response does not
imply in itself that the resource requires optimistic concurrency
Expand Down

0 comments on commit 3414a50

Please sign in to comment.