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

Clarify inclusion of @odata.id if key fields are not selected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_OS
    • Fix Version/s: V4.0_ERRATA01
    • Component/s: JSON Format
    • Labels:
      None
    • Environment:

      [Proposed][Applied]

    • Proposal:
      Hide

      Change:
      "The odata.id annotation MUST appear in responses if odata.metadata=full is requested or if the entity-id is not identical to the canonical URL of the entity..."
      to:
      "The odata.id annotation MUST appear in responses if odata.metadata=full is requested, or if odata.metadata=minimal is requested and any of the entity's key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity..."

      Show
      Change: "The odata.id annotation MUST appear in responses if odata.metadata=full is requested or if the entity-id is not identical to the canonical URL of the entity..." to: "The odata.id annotation MUST appear in responses if odata.metadata=full is requested, or if odata.metadata=minimal is requested and any of the entity's key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity..."

      Description

      In minimal metadata the service omits metadata that can be derived by the client from the payload based on convention, which implies that metadata must be included if it cannot be derived from the payload based on convention. However, in the rules for including @odata.id we don't explicitly mention that the id, which can only be computed if key properties are included in the payload, is thus returned if any key properties are omitted from the response.

      This is bad, because if services don't realize they need to include the key fields in this case it will cause clients to be unable to track entities (for example, in doing a merge). Even worse, in delta responses the payload for an updated entity is only required to include changed properties, so if the keys haven't changed (which, by definition, they can't) and the service omits them, the client has no way to correlate the change with the original entity.

      Also, the existing rules omit the case for odata.metadata=none.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: