Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1588

Allow creating and linking along a nullable single-valued navigation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02
    • Component/s: Protocol
    • Labels:
      None
    • Proposal:
      Hide

      Remove restriction on "containment" and allow PUT/PATCH if

      • a NavigationPropertyBinding exists for the target navigation property, or
      • the payload includes a context specifying where the new entity is to be created

      This affects the second paragraph of section 11.4.4 Upsert an Entity.

      Current text:

      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.

      New text:

      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.

      Show
      Remove restriction on "containment" and allow PUT/PATCH if a NavigationPropertyBinding exists for the target navigation property, or the payload includes a context specifying where the new entity is to be created This affects the second paragraph of section  11.4.4 Upsert an Entity . Current text: 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. New text: 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.
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-specs/pull/176

      Description

      ODATA-1141 explicitly forbids creating a to-one related entity for non-containment navigation properties:

      For a non-containment relationship, PUT or PATCH to a null single-valued navigation property returns an error.

      The only way currently to do this is multi-step:

      1. Create new entity in target set
      2. Bind to newly created entity

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: