Section 11.4.9.3 |
Setting a complex property to a different type |
ODATA-1472 |
@@ -1896,7 +1901,13 @@ An upsert occurs when the client sends an update request to a valid URL that identifies a single entity that does not yet exist. In this case the service MUST handle the request as a create entity request or fail the request altogether.
-Upserts are not supported against media entities, single-valued non-containment navigation properties, or entities whose keys values are generated by the service. Services MUST fail an update request to a URL that would identify such an entity and the entity does not yet exist.
+Upserts to single-valued navigation properties are possible for
+
+- containment navigation properties,
+- non-containment navigation properties with a navigation property binding, or
+- payloads including a context URL specifying the entity set or contained collection of entities in which the new entity is to be created.
+
+Upserts are not supported against media entities or entities whose keys values are generated by the service. Services MUST fail an update request to a URL that would identify such an entity and the entity does not yet exist.
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.
Key and other non-updatable properties, as well as dependent properties that are not tied to key properties of the principal entity, MUST be ignored by the service in processing the Upsert request.
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.
diff --git a/docs/odata-protocol/odata-protocol.md b/docs/odata-protocol/odata-protocol.md
index c5a82c496..c534f35c4 100644
--- a/docs/odata-protocol/odata-protocol.md
+++ b/docs/odata-protocol/odata-protocol.md
@@ -347,6 +347,7 @@ resource representations that are exchanged using OData.
Section | Feature / Change | Issue
--------|------------------|------
[Section 11.4](#DataModification)| Response code `204 No Content` after successful data modification if requested response could not be constructed| [ODATA-1609](https://issues.oasis-open.org/browse/ODATA-1609)
+[Section 11.4.4](#UpsertanEntity)| Upserts to single-valued non-containment navigation properties| [ODATA-1588](https://issues.oasis-open.org/browse/ODATA-1588)
[Section 11.4.9.3](#UpdateaComplexProperty)| Setting a complex property to a different type| [ODATA-1472](https://issues.oasis-open.org/browse/ODATA-1472)
## 1.2 Glossary
@@ -4521,11 +4522,16 @@ that does not yet exist. In this case the service MUST handle the
request as a [create entity request](#CreateanEntity) or fail the
request altogether.
+Upserts to single-valued navigation properties are possible for
+- containment navigation properties,
+- non-containment navigation properties with a navigation property binding, or
+- payloads including a context URL specifying the entity set or
+ contained collection of entities in which the new entity is to be created.
+
Upserts are not supported against [media
-entities](#RequestingtheMediaStreamofaMediaEntityusingvalue), single-valued
-non-containment navigation properties, or entities whose keys values are
-generated by the service. Services MUST fail an update request to a URL
-that would identify such an entity and the entity does not yet exist.
+entities](#RequestingtheMediaStreamofaMediaEntityusingvalue)
+or entities whose keys values are
+generated by the service. Services MUST fail an update request to a URL that would identify such an entity and the entity does not yet exist.
Singleton entities can be upserted if they are nullable. Services
supporting this SHOULD advertise it by annotating the singleton with the
diff --git a/odata-protocol/1 Introduction.md b/odata-protocol/1 Introduction.md
index 3799d9fb7..0dfe8a4d5 100644
--- a/odata-protocol/1 Introduction.md
+++ b/odata-protocol/1 Introduction.md
@@ -29,6 +29,9 @@ Section | Feature / Change | Issue
[Section ##DataModification]|
Response code `204 No Content` after successful data modification if requested response could not be constructed|
[ODATA-1609](https://issues.oasis-open.org/browse/ODATA-1609)
+[Section ##UpsertanEntity]|
+ Upserts to single-valued non-containment navigation properties|
+[ODATA-1588](https://issues.oasis-open.org/browse/ODATA-1588)
[Section ##UpdateaComplexProperty]|
Setting a complex property to a different type|
[ODATA-1472](https://issues.oasis-open.org/browse/ODATA-1472)
diff --git a/odata-protocol/11.4 Data Modification.md b/odata-protocol/11.4 Data Modification.md
index 7a4241059..6ab0ebfe3 100644
--- a/odata-protocol/11.4 Data Modification.md
+++ b/odata-protocol/11.4 Data Modification.md
@@ -544,10 +544,16 @@ that does not yet exist. In this case the service MUST handle the
request as a [create entity request](#CreateanEntity) or fail the
request altogether.
+Upserts to single-valued navigation properties are possible for
+- containment navigation properties,
+- non-containment navigation properties with a navigation property binding, or
+- payloads including a context URL specifying the entity set or
+ contained collection of entities in which the new entity is to be created.
+
Upserts are not supported against [media
-entities](#RequestingtheMediaStreamofaMediaEntityusingvalue), single-valued
-non-containment navigation properties, or entities whose keys values are
-generated by the service. Services MUST fail an update request to a URL
+entities](#RequestingtheMediaStreamofaMediaEntityusingvalue)
+or entities whose keys values are
+generated by the service. Services MUST fail an update request to a URL
that would identify such an entity and the entity does not yet exist.
Singleton entities can be upserted if they are nullable. Services