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

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



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



      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.




            • Assignee:
              mikep Michael Pizzo
            • Watchers:
              2 Start watching this issue


              • Created: