From 16c5799c48b166337f4c107d66c5be62c04004a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Thei=C3=9Fen?= Date: Thu, 28 Nov 2024 15:34:43 +0100 Subject: [PATCH] @ralfhandl's suggestion --- docs/odata-json-format/odata-json-format.html | 2 +- docs/odata-json-format/odata-json-format.md | 4 ++-- docs/odata-protocol/odata-protocol.html | 13 +++++++------ docs/odata-protocol/odata-protocol.md | 9 ++++++--- odata-json-format/4 Common Characteristics.md | 4 ++-- odata-protocol/1 Introduction.md | 6 +++--- odata-protocol/11.4 Data Modification.md | 7 +++++-- 7 files changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/odata-json-format/odata-json-format.html b/docs/odata-json-format/odata-json-format.html index a1b3890c..c20e7c00 100644 --- a/docs/odata-json-format/odata-json-format.html +++ b/docs/odata-json-format/odata-json-format.html @@ -778,7 +778,7 @@

The etag control information MAY be applied to an entity 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.

-

For details on how ETags are used, see OData-Protocol, section 11.4.1.1. The special value "@etag": "" has the same meaning as the header If-None-Match: *, see OData-Protocol, section 11.4.4.

+

For details on how ETags are used, see OData-Protocol, section 11.4.1.1. The special value "@etag": "" is equivalent to the header If-None-Match: *, see OData-Protocol, section 11.4.12.

The etag control information is ignored in request payloads for single entities and not written in responses if metadata=none is requested.

diff --git a/docs/odata-json-format/odata-json-format.md b/docs/odata-json-format/odata-json-format.md index 5227d0af..dc88008f 100644 --- a/docs/odata-json-format/odata-json-format.md +++ b/docs/odata-json-format/odata-json-format.md @@ -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 diff --git a/docs/odata-protocol/odata-protocol.html b/docs/odata-protocol/odata-protocol.html index c956f53a..c7633b11 100644 --- a/docs/odata-protocol/odata-protocol.html +++ b/docs/odata-protocol/odata-protocol.html @@ -599,15 +599,15 @@

455 -Section 11.4.4 -Empty @etag to prevent inserts -2021 - - Section 11.4.9.3 Setting a complex property to a different type 534 + +Section 11.4.12 +Control information to prevent updates +2021 + Section 11.4.13 Semantics of continue-on-error when replacing a collection of entities @@ -2568,7 +2568,7 @@

11.

Singleton entities can be upserted if they are nullable. Services supporting this SHOULD advertise it by annotating the singleton with the term Capabilities.UpdateRestrictions (nested property Upsertable with value true) defined in OData-VocCap.

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.

To ensure that an update request is not treated as an insert, the client MAY specify an If-Match header in the update request. The service MUST NOT treat an update request containing an If-Match header as an insert.

-

A PUT or PATCH request MUST NOT be treated as an update if an If-None-Match header is specified with a value of * or the @etag control information OData-JSON, section 4.6.10 is specified with an empty string as value.

+

A PUT or PATCH request MUST NOT be treated as an update if an If-None-Match header is specified with a value of *.

11.4.5 Delete an Entity

@@ -2764,6 +2764,7 @@

Core.ContentID term defined in OData-VocCore. Services that respond with 200 OK SHOULD annotate the entities in the response using the same Core.ContentID value as specified in the request.

Services SHOULD advertise support for updating a collection using a delta payload through the DeltaUpdateSupported property of the Capabilities.UpdateRestrictions term, and SHOULD advertise support for returning the Core.ContentID through the ContentIDSupported property of the Capabilities.DeepUpdateSupport term, both defined in OData-VocCap.

For each entity being updated or removed, clients MAY specify an ETag 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 report 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 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.

11.4.12.1 Error Handling when Updating a Collection of Entities

diff --git a/docs/odata-protocol/odata-protocol.md b/docs/odata-protocol/odata-protocol.md index dcc083f6..9ec59e66 100644 --- a/docs/odata-protocol/odata-protocol.md +++ b/docs/odata-protocol/odata-protocol.md @@ -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) @@ -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 `*`. ### 11.4.5 Delete an Entity @@ -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. diff --git a/odata-json-format/4 Common Characteristics.md b/odata-json-format/4 Common Characteristics.md index 96212944..5ec11f9a 100644 --- a/odata-json-format/4 Common Characteristics.md +++ b/odata-json-format/4 Common Characteristics.md @@ -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 diff --git a/odata-protocol/1 Introduction.md b/odata-protocol/1 Introduction.md index 0c0cafca..91a8b640 100644 --- a/odata-protocol/1 Introduction.md +++ b/odata-protocol/1 Introduction.md @@ -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) diff --git a/odata-protocol/11.4 Data Modification.md b/odata-protocol/11.4 Data Modification.md index 9b2eea9b..47fcdd5c 100644 --- a/odata-protocol/11.4 Data Modification.md +++ b/odata-protocol/11.4 Data Modification.md @@ -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 @@ -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.