-
Notifications
You must be signed in to change notification settings - Fork 3
Open
oasis-tcs/odata-vocabularies
#299Labels
Description
Consider an entity set Orders
with a containment navigation property Items
and assume that the item property ItemType
is mandatory during item creation.
For a request like POST Orders(...)/Items
, this is expressed as:
<Annotations Target="ns.Container/Orders/Items">
<Annotation Term="Capabilities.InsertRestrictions">
<Record>
<PropertyValue Property="RequiredProperties">
<Collection>
<PropertyPath>ItemType</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
But how can the requirement be expressed for a deep insert POST Orders
with the Items
navigation property in the payload?
<Annotations Target="ns.Container/Orders">
<Annotation Term="Capabilities.InsertRestrictions">
<Record>
<PropertyValue Property="RequiredProperties">
<Collection>
<PropertyPath>Items/ItemType</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
goes too far: It seems to require that the payload always contains Items
.
To which requests does the following alternative apply?
- An insert
POST Orders(...)/Items
- A deep insert
POST Orders
withItems
in the payload
<Annotations Target="ns.Container/Orders">
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Items" />
<PropertyValue Property="InsertRestrictions">
<Record>
<PropertyValue Property="RequiredProperties">
<Collection>
<PropertyPath>Items/ItemType</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
If this applies to deep inserts, does it mandate the ItemType
in an item without also mandating the Items
?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Open