diff --git a/docs/odata-json-format/odata-json-format.html b/docs/odata-json-format/odata-json-format.html index ca164815..c99d1bcd 100644 --- a/docs/odata-json-format/odata-json-format.html +++ b/docs/odata-json-format/odata-json-format.html @@ -679,7 +679,7 @@

RFC3986.

Note that the entity-id MUST be invariant across languages, so if key values are language dependent then the id MUST be included if it does not match convention for the localized key values. If the id is represented, it MAY be a relative URL.

-

If the entity is transient (i.e. cannot be read or updated), the id control information MUST appear in OData 4.0 payloads and have the null value. In 4.01 payloads transient entities need not have the id control information, and 4.01 clients MUST treat entities with neither id control information nor a full set of key properties as transient entities.

+

If the entity is transient (see OData-Protocol), the id control information MUST appear in OData 4.0 payloads and have the null value. In 4.01 payloads transient entities need not have the id control information, and 4.01 clients MUST treat entities with neither id control information nor a full set of key properties as transient entities.

The id control information MUST NOT appear for a collection. Its meaning in this context is reserved for future versions of this specification.

Entities with id equal to null cannot be compared to other entities, reread, or updated. If metadata=minimal is specified and the id is not present in the entity, then the canonical URL MUST be used as the entity-id.

diff --git a/docs/odata-json-format/odata-json-format.md b/docs/odata-json-format/odata-json-format.md index fc06a36a..8c0d7f3f 100644 --- a/docs/odata-json-format/odata-json-format.md +++ b/docs/odata-json-format/odata-json-format.md @@ -962,7 +962,7 @@ if it does not match convention for the localized key values. If the `id` is represented, it MAY be a [relative URL](#RelativeURLs). -If the entity is transient (i.e. cannot be read or updated), the +If the entity is transient (see [OData-Protocol](#ODataProtocol)), the `id` control information MUST appear in OData 4.0 payloads and have the `null` value. In 4.01 payloads transient entities need not have the `id` control information, and 4.01 diff --git a/docs/odata-protocol/odata-protocol.html b/docs/odata-protocol/odata-protocol.html index 23bf75df..5b265d00 100644 --- a/docs/odata-protocol/odata-protocol.html +++ b/docs/odata-protocol/odata-protocol.html @@ -508,31 +508,36 @@

+Section 8.2.8.3 +Responses that include errors MUST include the Preference-Applied header with continue-on-error set to true +1965 + + Section 10.2 Context URLs use parentheses-style keys without percent-encoding 368 - + Section 11.4 Response code 204 No Content after successful data modification if requested response could not be constructed 443 - + Section 11.4.4 Upserts to single-valued non-containment navigation properties 455 - + Section 11.4.9.3 Setting a complex property to a different type 534 - + Section 12 Allow 400 Bad Request in addition to 501 Not Implemented for unsupported functionality 391 - + Section 12.3 Encoding of plus character in URLs 485 @@ -653,7 +658,7 @@

4 Service M

4.1 Entity-Ids and Entity References

Whereas entities within an entity set are uniquely identified by their key values, entities are also uniquely identified by a durable, opaque, globally unique entity-id. The entity-id MUST be an IRI as defined in RFC3987 and MAY be expressed in payloads, headers, and URLs as a relative reference as appropriate. While the client MUST be prepared to accept any IRI, services MUST use valid URIs in this version of the specification since there is currently no lossless representation of an IRI in the EntityId header.

-

Services are strongly encouraged to use the canonical URL for an entity as defined in OData-URL as its entity-id, but clients cannot assume the entity-id can be used to locate the entity unless the Core.DereferenceableIDs term is applied to the entity container, nor can the client assume any semantics from the structure of the entity-id. The canonical resource $entity provides a general mechanism for resolving an entity-id into an entity representation.

+

Services are strongly encouraged to use the canonical URL for an entity as defined in OData-URL as its entity-id, but clients cannot assume the entity-id can be used to locate the entity unless the Core.DereferenceableIDs term is applied to the entity container, nor can the client assume any semantics from the structure of the entity-id. The canonical resource $entity provides a general mechanism for resolving an entity-id into an entity representation.

Services that use the standard URL conventions for entity-ids annotate their entity container with the term Core.ConventionalIDs, see OData-VocCore.

Entity references refer to an entity using the entity’s entity-id.

@@ -663,7 +668,7 @@

OData-URL for both the read URL and the edit URL of an entity, with a cast segment to the type of the entity appended to the canonical URL if the type of the entity is derived from the declared type of the entity set. However, clients cannot assume this convention and must use the links specified in the payload according to the appropriate format as the two URLs may be different from one another, or one or both of them may differ from convention.

4.3 Transient Entities

@@ -937,6 +942,7 @@

batch request is used to request whether, upon encountering a request within the batch that returns an error, the service return the error for that request and continue processing additional requests within the batch (if specified with an implicit or explicit value of true), or rather stop further processing (if specified with an explicit value of false). The syntax of the continue-on-error preference is defined in OData-ABNF.

The continue-on-error preference can also be used on a delta update, set-based update, or set-based delete to request that the service continue attempting to process changes after receiving an error.

+

If the service encounters any errors processing the request and returns a successful response code, then it MUST include a Preference-Applied response header containing the continue-on-error preference with an explicit value of true.

A service MAY specify support for the continue-on-error preference using an annotation with term Capabilities.BatchContinueOnErrorSupported, see OData-VocCap.

The continue-on-error preference SHOULD NOT be applied to individual requests within a batch.

Note: The continue-on-error preference was named odata.continue-on-error in OData version 4.0. Services that support the continue-on-error preference SHOULD also support odata.continue-on-error for OData 4.0 clients and clients SHOULD use odata.continue-on-error for compatibility with OData 4.0 services.

@@ -1060,7 +1066,7 @@

8.3.2 Header ETag

A response MAY include an ETag header, see RFC9110. Services MUST include this header if they require an ETag to be specified when modifying the resource.

-

Services MUST support specifying the value returned in the ETag header in an If-None-Match header of a subsequent Data Request for the resource. Clients MUST specify the value returned in the ETag header, or star (*), in an If-Match header of a subsequent Data Modification Request or Action Request in order to apply optimistic concurrency control in updating, deleting, or invoking an action bound to the resource.

+

Services MUST support specifying the value returned in the ETag header in an If-None-Match header of a subsequent Data Request for the resource. Clients MUST specify the value returned in the ETag header, or star (*), in an If-Match header of a subsequent Data Modification Request or Action Request in order to apply optimistic concurrency control in updating, deleting, or invoking an action bound to the resource.

As OData allows multiple formats for representing the same structured information, services SHOULD use weak ETags that only depend on the representation-independent entity state. A strong ETag MUST change whenever the representation of an entity changes, so it has to depend on the Content-Type, the Content-Encoding, and potentially other characteristics of the response.

An ETag header MAY also be returned on a metadata document request or service document request to allow the client subsequently to make a conditional request for the metadata or service document. Clients can also compare the value of the ETag header returned from a metadata document request to the metadata ETag returned in a response in order to verify the version of the metadata used to generate that response.

The ETag header SHOULD NOT be included for the overall batch response, but MAY be included in individual responses within a batch.

@@ -2595,7 +2601,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.

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

-

If the continue-on-error preference has been specified and any errors occur in processing the changes, then a delta response MUST be returned regardless of the return preference and MUST contain at least the failed changes. The service represents failed changes in the delta response as follows:

+

If the client requests continue-on-error behavior and the service encounters any errors while processing the request, then it MUST either fail the entire request without applying any changes or include a Preference-Applied header in the response indicating that the continue-on-error preference has been applied. In this case, the delta response payload MUST be returned regardless of the return preference and MUST contain at least the failed changes. The service represents failed changes in the delta response as follows:

  • Failed deletes in the request MUST be represented in the response as either entities or entity references, annotated with the term Core.DataModificationException, see OData-VocCore. If the deleted entity specified a reason of deleted, the value of failedOperation MUST be delete, otherwise unlink.
  • Failed inserts within the request MUST be represented in the response as deleted entities annotated with the term Core.DataModificationException with a failedOperation value of insert.
  • diff --git a/docs/odata-protocol/odata-protocol.md b/docs/odata-protocol/odata-protocol.md index cdea8128..e8e0120e 100644 --- a/docs/odata-protocol/odata-protocol.md +++ b/docs/odata-protocol/odata-protocol.md @@ -351,6 +351,7 @@ resource representations that are exchanged using OData. Section | Feature / Change | Issue --------|------------------|------ +[Section 8.2.8.3](#Preferencecontinueonerrorodatacontinueonerror) | Responses that include errors MUST include the Preference-Applied header `with continue-on-error` set to `true` | [1965](https://github.com/oasis-tcs/odata-specs/issues/1965) [Section 10.2](#CollectionofEntities)| Context URLs use parentheses-style keys without percent-encoding| [368](https://github.com/oasis-tcs/odata-specs/issues/368) [Section 11.4](#DataModification)| Response code `204 No Content` after successful data modification if requested response could not be constructed| [443](https://github.com/oasis-tcs/odata-specs/issues/443) [Section 11.4.4](#UpsertanEntity)| Upserts to single-valued non-containment navigation properties| [455](https://github.com/oasis-tcs/odata-specs/issues/455) @@ -578,7 +579,7 @@ of the specification since there is currently no lossless representation of an IRI in the [`EntityId`](#HeaderODataEntityId) header. Services are strongly encouraged to use the canonical URL for an entity -as defined in **OData-URL** as its entity-id, but clients cannot assume +as defined in [OData-URL](#ODataURL) as its entity-id, but clients cannot assume the entity-id can be used to locate the entity unless the [`Core.DereferenceableIDs`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#DereferenceableIDs) term is applied to the entity container, nor can the client assume any @@ -605,7 +606,7 @@ The edit URL of a property is the edit URL of the entity with appended segment(s) containing the path to the property. Services are strongly encouraged to use the canonical URL for an entity -as defined in **OData-URL** for both the read URL and the edit URL of an +as defined in [OData-URL](#ODataURL) for both the read URL and the edit URL of an entity, with a cast segment to the type of the entity appended to the canonical URL if the type of the entity is derived from the declared type of the entity set. However, clients cannot assume this convention @@ -1328,6 +1329,8 @@ The `continue-on-error` preference can also be used on a [set-based delete](#DeleteMembersofaCollection) to request that the service continue attempting to process changes after receiving an error. +If the service encounters any errors processing the request and returns a successful response code, then it MUST include a [`Preference-Applied`](#HeaderPreferenceApplied) response header containing the `continue-on-error` preference with an explicit value of `true`. + A service MAY specify support for the `continue-on-error` preference using an annotation with term [`Capabilities.BatchContinueOnErrorSupported`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#BatchContinueOnErrorSupported), @@ -1667,8 +1670,8 @@ Request](#RequestingData) for the resource. Clients MUST specify the value returned in the `ETag` header, or star (`*`), in an [`If-Match`](#HeaderIfMatch) header of a subsequent [Data Modification Request](#DataModification) or [Action Request](#Actions) in order to -apply [optimistic concurrency](#UseofETagsforAvoidingUpdateConflicts) -control in updating, deleting, or invoking an action bound to the +apply [optimistic concurrency control](#UseofETagsforAvoidingUpdateConflicts) +in updating, deleting, or invoking an action bound to the resource. As OData allows multiple formats for representing the same structured @@ -5018,8 +5021,7 @@ term, both defined in [OData-VocCap](#ODataVocCap). The response, if requested, is a delta payload, in the same structure and order as the request payload, representing the applied changes. -If the [`continue-on-error`](#Preferencecontinueonerrorodatacontinueonerror) preference has been specified and any errors -occur in processing the changes, then a delta response MUST be returned +If the client requests `continue-on-error` behavior and the service encounters any errors while processing the request, then it MUST either fail the entire request without applying any changes or include a [`Preference-Applied`](#HeaderPreferenceApplied) header in the response indicating that the [`continue-on-error`](#Preferencecontinueonerrorodatacontinueonerror) preference has been applied. In this case, the delta response payload MUST be returned regardless of the [`return`](#Preferencereturnrepresentationandreturnminimal) preference and MUST contain at least the failed changes. The service represents failed changes in the delta response as follows: diff --git a/odata-json-format/4 Common Characteristics.md b/odata-json-format/4 Common Characteristics.md index 7f9f2eb4..8190d1c1 100644 --- a/odata-json-format/4 Common Characteristics.md +++ b/odata-json-format/4 Common Characteristics.md @@ -417,7 +417,7 @@ if it does not match convention for the localized key values. If the `id` is represented, it MAY be a [relative URL](#RelativeURLs). -If the entity is transient (i.e. cannot be read or updated), the +If the entity is transient (see [OData-Protocol](#ODataProtocol)), the `id` control information MUST appear in OData 4.0 payloads and have the `null` value. In 4.01 payloads transient entities need not have the `id` control information, and 4.01 diff --git a/odata-protocol/1 Introduction.md b/odata-protocol/1 Introduction.md index 0de95e39..579ae929 100644 --- a/odata-protocol/1 Introduction.md +++ b/odata-protocol/1 Introduction.md @@ -26,6 +26,7 @@ resource representations that are exchanged using OData. Section | Feature / Change | Issue --------|------------------|------ +[Section ##Preferencecontinueonerrorodatacontinueonerror] | Responses that include errors MUST include the Preference-Applied header `with continue-on-error` set to `true` | [1965](https://github.com/oasis-tcs/odata-specs/issues/1965) [Section ##CollectionofEntities]| Context URLs use parentheses-style keys without percent-encoding| [368](https://github.com/oasis-tcs/odata-specs/issues/368) @@ -261,7 +262,7 @@ of the specification since there is currently no lossless representation of an IRI in the [`EntityId`](#HeaderODataEntityId) header. Services are strongly encouraged to use the canonical URL for an entity -as defined in **OData-URL** as its entity-id, but clients cannot assume +as defined in [OData-URL](#ODataURL) as its entity-id, but clients cannot assume the entity-id can be used to locate the entity unless the [`Core.DereferenceableIDs`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#DereferenceableIDs) term is applied to the entity container, nor can the client assume any @@ -288,7 +289,7 @@ The edit URL of a property is the edit URL of the entity with appended segment(s) containing the path to the property. Services are strongly encouraged to use the canonical URL for an entity -as defined in **OData-URL** for both the read URL and the edit URL of an +as defined in [OData-URL](#ODataURL) for both the read URL and the edit URL of an entity, with a cast segment to the type of the entity appended to the canonical URL if the type of the entity is derived from the declared type of the entity set. However, clients cannot assume this convention diff --git a/odata-protocol/11.4 Data Modification.md b/odata-protocol/11.4 Data Modification.md index 21dab668..6b97d7fb 100644 --- a/odata-protocol/11.4 Data Modification.md +++ b/odata-protocol/11.4 Data Modification.md @@ -1043,8 +1043,7 @@ term, both defined in [OData-VocCap](#ODataVocCap). The response, if requested, is a delta payload, in the same structure and order as the request payload, representing the applied changes. -If the [`continue-on-error`](#Preferencecontinueonerrorodatacontinueonerror) preference has been specified and any errors -occur in processing the changes, then a delta response MUST be returned +If the client requests `continue-on-error` behavior and the service encounters any errors while processing the request, then it MUST either fail the entire request without applying any changes or include a [`Preference-Applied`](#HeaderPreferenceApplied) header in the response indicating that the [`continue-on-error`](#Preferencecontinueonerrorodatacontinueonerror) preference has been applied. In this case, the delta response payload MUST be returned regardless of the [`return`](#Preferencereturnrepresentationandreturnminimal) preference and MUST contain at least the failed changes. The service represents failed changes in the delta response as follows: diff --git a/odata-protocol/8 Header Fields.md b/odata-protocol/8 Header Fields.md index 0e926a09..d0db02a8 100644 --- a/odata-protocol/8 Header Fields.md +++ b/odata-protocol/8 Header Fields.md @@ -439,6 +439,8 @@ The `continue-on-error` preference can also be used on a [set-based delete](#DeleteMembersofaCollection) to request that the service continue attempting to process changes after receiving an error. +If the service encounters any errors processing the request and returns a successful response code, then it MUST include a [`Preference-Applied`](#HeaderPreferenceApplied) response header containing the `continue-on-error` preference with an explicit value of `true`. + A service MAY specify support for the `continue-on-error` preference using an annotation with term [`Capabilities.BatchContinueOnErrorSupported`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#BatchContinueOnErrorSupported), @@ -778,8 +780,8 @@ Request](#RequestingData) for the resource. Clients MUST specify the value returned in the `ETag` header, or star (`*`), in an [`If-Match`](#HeaderIfMatch) header of a subsequent [Data Modification Request](#DataModification) or [Action Request](#Actions) in order to -apply [optimistic concurrency](#UseofETagsforAvoidingUpdateConflicts) -control in updating, deleting, or invoking an action bound to the +apply [optimistic concurrency control](#UseofETagsforAvoidingUpdateConflicts) +in updating, deleting, or invoking an action bound to the resource. As OData allows multiple formats for representing the same structured