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

Don't need TargetId in a deleted link for a to 0..1 relationship

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_ERRATA02
    • Fix Version/s: V4.01_WD01
    • Component/s: JSON Format
    • Labels:
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      If a client does not specify an odata.maxversion=4.0 header, services may omit the target on a deleted link optional if the maximum cardinality of the related entity is one.

      Show
      If a client does not specify an odata.maxversion=4.0 header, services may omit the target on a deleted link optional if the maximum cardinality of the related entity is one.
    • Resolution:
      Show
      https://www.oasis-open.org/apps/org/workgroup/odata/download.php/59030/odata-json-format-v4.01-wd01.docx

      Description

      Note: in OData 807 we added to errata 2 that clients should not expect targetid for deleted links for to 0..1 relationships. This allows 4.01 services to omit that information:

      The JSON format spec provides specific ruled about when deleted links must be rendered:

      Delta responses MUST contain a deleted-link object for each deleted link that corresponds to a $expand path in the initial request, unless either of the following is true:
      • The source or target entity has been deleted
      • The maximum cardinality of the related entity is one and there is a subsequent link object that specifies the same source and relationship.

      This makes sense, because with a single valued navigation property, the source and the relationship in the required link object uniquely identify the navigation property that is having it’s value replaced.

      There is a similar case of when a single-valued navigation property has it’s link removed. In that case, the only data needed to identify the link that should be removed is the source and the relationship.

      Today, however, the spec says that the target for the link being removed must also be provided:

      The deleted-link object MUST include the following properties, regardless of the specified odata.metadata value
      • odata.context – the context URL fragment MUST be #

      {entity-set}/$deletedLink, where {entity-set}

      is the entity set containing the source entity
      • source – The id of the entity from which the relationship is defined, which may be absolute or relative
      • relationship – The name of the relationship property on the parent object
      • target – The id of the related entity, which may be absolute or relative

      The requirement to include the target in this scenario raises the complexity and cost for the service to do “field level” tracking as this kind of relationship is typically implemented with a foreign key column.

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: