Skip to content

Commit

Permalink
@ralfhandl's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Nov 28, 2024
1 parent 196f42d commit 16c5799
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/odata-json-format/odata-json-format.html
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ <h3 id="469-control-information-editlink-and-readlink-odataeditlink-and-odatarea
<h3 id="4610-control-information-etag-odataetag"><a id="ControlInformationetagodataetag" href="#ControlInformationetagodataetag">4.6.10 Control Information: <code>etag</code> (<code>odata.etag</code>)</a></h3>
</summary>
<p>The <code>etag</code> control information MAY be applied to an <a href="#Entity">entity</a> or collection in a response. The value of the control information is an entity tag (ETag) which is an opaque string value that can be used in a subsequent request to determine if the value of the entity or collection has changed.</p>
<p>For details on how ETags are used, see <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UseofETagsforAvoidingUpdateConflicts">OData-Protocol, section 11.4.1.1</a>. The special value <code>"@etag": ""</code> has the same meaning as the header <code>If-None-Match: *</code>, see <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UpsertanEntity">OData-Protocol, section 11.4.4</a>.</p>
<p>For details on how ETags are used, see <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UseofETagsforAvoidingUpdateConflicts">OData-Protocol, section 11.4.1.1</a>. The special value <code>"@etag": ""</code> is equivalent to the header <code>If-None-Match: *</code>, see <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UpdateaCollectionofEntities">OData-Protocol, section 11.4.12</a>.</p>
<p>The <code>etag</code> control information is ignored in request payloads for single entities and not written in responses if <a href="#metadatanoneodatametadatanone"><code>metadata=none</code></a> is requested.</p>
</details>
<details open><summary>
Expand Down
4 changes: 2 additions & 2 deletions docs/odata-json-format/odata-json-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ opaque string value that can be used in a subsequent request to
determine if the value of the entity or collection has changed.

For details on how ETags are used, see [OData-Protocol, section 11.4.1.1](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UseofETagsforAvoidingUpdateConflicts).
The special value `"@etag": ""` has the same meaning as the header `If-None-Match: *`,
see [OData-Protocol, section 11.4.4](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UpsertanEntity).
The special value `"@etag": ""` is equivalent to the header `If-None-Match: *`,
see [OData-Protocol, section 11.4.12](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#UpdateaCollectionofEntities).

The `etag` control information is ignored in request payloads for
single entities and not written in responses if
Expand Down
13 changes: 7 additions & 6 deletions docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,15 @@ <h2 id="11-changes-from-earlier-versions"><a id="ChangesfromEarlierVersions" hre
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/455">455</a></td>
</tr>
<tr class="even">
<td><a href="#UpsertanEntity">Section 11.4.4</a></td>
<td>Empty <code>@etag</code> to prevent inserts</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/2021">2021</a></td>
</tr>
<tr class="odd">
<td><a href="#UpdateaComplexProperty">Section 11.4.9.3</a></td>
<td>Setting a complex property to a different type</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/534">534</a></td>
</tr>
<tr class="odd">
<td><a href="#UpdateaCollectionofEntities">Section 11.4.12</a></td>
<td>Control information to prevent updates</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/2021">2021</a></td>
</tr>
<tr class="even">
<td><a href="#ReplaceaCollectionofEntities">Section 11.4.13</a></td>
<td>Semantics of <code>continue-on-error</code> when replacing a collection of entities</td>
Expand Down Expand Up @@ -2568,7 +2568,7 @@ <h3 id="1144-upsert-an-entity"><a id="UpsertanEntity" href="#UpsertanEntity">11.
<p>Singleton entities can be upserted if they are nullable. Services supporting this SHOULD advertise it by annotating the singleton with the term <code>Capabilities.UpdateRestrictions</code> (nested property <code>Upsertable</code> with value <code>true</code>) defined in <a href="#ODataVocCap">OData-VocCap</a>.</p>
<p>A key property whose value is provided in the request URL SHOULD be omitted from the request body. If key properties are provided in the request URL and the request body with different values, services MUST either fail the request or ignore the value in the request body.</p>
<p>To ensure that an update request is not treated as an insert, the client MAY specify an <a href="#HeaderIfMatch"><code>If-Match</code></a> header in the update request. The service MUST NOT treat an update request containing an <code>If-Match</code> header as an insert.</p>
<p>A <code>PUT</code> or <code>PATCH</code> request MUST NOT be treated as an update if an <a href="#HeaderIfNoneMatch"><code>If-None-Match</code></a> header is specified with a value of <code>*</code> or the <code>@etag</code> control information <a href="https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformationetagodataetag">OData-JSON, section 4.6.10</a> is specified with an empty string as value.</p>
<p>A <code>PUT</code> or <code>PATCH</code> request MUST NOT be treated as an update if an <a href="#HeaderIfNoneMatch"><code>If-None-Match</code></a> header is specified with a value of <code>*</code>.</p>
</details>
<details open><summary>
<h3 id="1145-delete-an-entity"><a id="DeleteanEntity" href="#DeleteanEntity">11.4.5 Delete an Entity</a></h3>
Expand Down Expand Up @@ -2764,6 +2764,7 @@ <h3 id="11412-update-a-collection-of-entities"><a id="UpdateaCollectionofEntitie
<p>Clients MAY associate an id with individual nested entities in the request by using the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#ContentID"><code>Core.ContentID</code></a> term defined in <a href="#ODataVocCore">OData-VocCore</a>. Services that respond with <a href="#ResponseCode200OK"><code>200 OK</code></a> SHOULD annotate the entities in the response using the same <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#ContentID"><code>Core.ContentID</code></a> value as specified in the request.</p>
<p>Services SHOULD advertise support for updating a collection using a delta payload through the <code>DeltaUpdateSupported</code> property of the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#UpdateRestrictionsType"><code>Capabilities.UpdateRestrictions</code></a> term, and SHOULD advertise support for returning the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#ContentID"><code>Core.ContentID</code></a> through the <code>ContentIDSupported</code> property of the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#DeepUpdateSupportType"><code>Capabilities.DeepUpdateSupport</code></a> term, both defined in <a href="#ODataVocCap">OData-VocCap</a>.</p>
<p>For each entity being updated or removed, clients MAY specify an <a href="#UseofETagsforAvoidingUpdateConflicts">ETag</a> value obtained from a previous request. If an ETag is provided that does not match the ETag value of the entity being updated or removed, or if an ETag is provided when adding or updating an entity that does not currently exist, then services that support ETags MUST NOT apply the change and instead <a href="#ErrorHandlingwhenUpdatingaCollectionofEntities">report</a> a <code>412 Precondition Failed</code> error. The special value <code>*</code> can be used to match any existing entity but fail if the entity does not already exist.</p>
<p>Added/changed entities that specify format-specific control information equivalent to an <code>If-Match-None: *</code> header <a href="https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformationetagodataetag">OData-JSON, section 4.6.10</a> MUST NOT be treated as an update.</p>
<p>The response, if requested, is a delta payload, in the same structure and order as the request payload, representing the applied changes.</p>
<details open><summary>
<h4 id="114121-error-handling-when-updating-a-collection-of-entities"><a id="ErrorHandlingwhenUpdatingaCollectionofEntities" href="#ErrorHandlingwhenUpdatingaCollectionofEntities">11.4.12.1 Error Handling when Updating a Collection of Entities</a></h4>
Expand Down
9 changes: 6 additions & 3 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ Section | Feature / Change | Issue
[Section 11.4.2.2](#CreateRelatedEntitiesWhenCreatinganEntity)| Deep-insert response includes at least the properties present in the request| [363](https://github.com/oasis-tcs/odata-specs/issues/363)
[Section 11.4.3](#UpdateanEntity)| Services can validate non-updatable property values in update payloads| [356](https://github.com/oasis-tcs/odata-specs/issues/356)
[Section 11.4.4](#UpsertanEntity)| Upserts to single-valued non-containment navigation properties| [455](https://github.com/oasis-tcs/odata-specs/issues/455)
[Section 11.4.4](#UpsertanEntity)| Empty `@etag` to prevent inserts| [2021](https://github.com/oasis-tcs/odata-specs/issues/2021)
[Section 11.4.9.3](#UpdateaComplexProperty)| Setting a complex property to a different type| [534](https://github.com/oasis-tcs/odata-specs/issues/534)
[Section 11.4.12](#UpdateaCollectionofEntities)| Control information to prevent updates| [2021](https://github.com/oasis-tcs/odata-specs/issues/2021)
[Section 11.4.13](#ReplaceaCollectionofEntities)| Semantics of `continue-on-error` when replacing a collection of entities | [358](https://github.com/oasis-tcs/odata-specs/issues/358)
[Section 12](#Conformance) | Allow `400 Bad Request` in addition to `501 Not Implemented` for unsupported functionality| [391](https://github.com/oasis-tcs/odata-specs/issues/391)
[Section 12.3](#InteroperableODataClients) | Encoding of plus character in URLs | [485](https://github.com/oasis-tcs/odata-specs/issues/485)
Expand Down Expand Up @@ -4712,8 +4712,7 @@ request. The service MUST NOT treat an update request containing an

A `PUT` or `PATCH` request MUST NOT be treated as an update if an
[`If-None-Match`](#HeaderIfNoneMatch) header is specified with a value
of `*` or the `@etag` control information [OData-JSON, section 4.6.10](https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformationetagodataetag)
is specified with an empty string as value.
of `*`.

### <a id="DeleteanEntity" href="#DeleteanEntity">11.4.5 Delete an Entity</a>

Expand Down Expand Up @@ -5184,6 +5183,10 @@ then services that support ETags MUST NOT apply the change and instead
[report](#ErrorHandlingwhenUpdatingaCollectionofEntities) a `412 Precondition Failed` error.
The special value `*` can be used to match any existing entity but fail if the entity does not already exist.

Added/changed entities that specify format-specific control information
equivalent to an `If-Match-None: *` header [OData-JSON, section 4.6.10](https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformationetagodataetag)
MUST NOT be treated as an update.

The response, if requested, is a delta payload, in the same structure
and order as the request payload, representing the applied changes.

Expand Down
4 changes: 2 additions & 2 deletions odata-json-format/4 Common Characteristics.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ opaque string value that can be used in a subsequent request to
determine if the value of the entity or collection has changed.

For details on how ETags are used, see [#OData-Protocol#UseofETagsforAvoidingUpdateConflicts].
The special value `"@etag": ""` has the same meaning as the header `If-None-Match: *`,
see [#OData-Protocol#UpsertanEntity].
The special value `"@etag": ""` is equivalent to the header `If-None-Match: *`,
see [#OData-Protocol#UpdateaCollectionofEntities].

The `etag` control information is ignored in request payloads for
single entities and not written in responses if
Expand Down
6 changes: 3 additions & 3 deletions odata-protocol/1 Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Services can validate non-updatable property values in update payloads|
[Section ##UpsertanEntity]|
Upserts to single-valued non-containment navigation properties|
[455](https://github.com/oasis-tcs/odata-specs/issues/455)
[Section ##UpsertanEntity]|
Empty `@etag` to prevent inserts|
[2021](https://github.com/oasis-tcs/odata-specs/issues/2021)
[Section ##UpdateaComplexProperty]|
Setting a complex property to a different type|
[534](https://github.com/oasis-tcs/odata-specs/issues/534)
[Section ##UpdateaCollectionofEntities]|
Control information to prevent updates|
[2021](https://github.com/oasis-tcs/odata-specs/issues/2021)
[Section ##ReplaceaCollectionofEntities]| Semantics of `continue-on-error` when replacing a collection of entities | [358](https://github.com/oasis-tcs/odata-specs/issues/358)
[Section ##Conformance] | Allow `400 Bad Request` in addition to `501 Not Implemented` for unsupported functionality| [391](https://github.com/oasis-tcs/odata-specs/issues/391)
[Section ##InteroperableODataClients] | Encoding of plus character in URLs | [485](https://github.com/oasis-tcs/odata-specs/issues/485)
Expand Down
7 changes: 5 additions & 2 deletions odata-protocol/11.4 Data Modification.md
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,7 @@ request. The service MUST NOT treat an update request containing an

A `PUT` or `PATCH` request MUST NOT be treated as an update if an
[`If-None-Match`](#HeaderIfNoneMatch) header is specified with a value
of `*` or the `@etag` control information [#OData-JSON#ControlInformationetagodataetag]
is specified with an empty string as value.
of `*`.

### ##subsubsec Delete an Entity

Expand Down Expand Up @@ -1168,6 +1167,10 @@ then services that support ETags MUST NOT apply the change and instead
[report](#ErrorHandlingwhenUpdatingaCollectionofEntities) a `412 Precondition Failed` error.
The special value `*` can be used to match any existing entity but fail if the entity does not already exist.

Added/changed entities that specify format-specific control information
equivalent to an `If-Match-None: *` header [#OData-JSON#ControlInformationetagodataetag]
MUST NOT be treated as an update.

The response, if requested, is a delta payload, in the same structure
and order as the request payload, representing the applied changes.

Expand Down

0 comments on commit 16c5799

Please sign in to comment.