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

OData 4.01 JSON "Delta Responses" doesn't describe use of "@id" (or "@odata.id") for Added/Changed Entity

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.01_ERRATA01
    • Component/s: JSON Format
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      "@id" (or "@odata.id") is optional, for consistency (in 4.01 at least) with deleted entities, and to reduce payload bloat (in the case of added entities, where the key properties must already be present if they were selected).

      We need to clarify the 4.0 rules here as well, since the 4.01 spec covers both versions.

      Need to review both the 4.0 and 4.01 text for compatibility

      Show
      "@id" (or "@odata.id") is optional, for consistency (in 4.01 at least) with deleted entities, and to reduce payload bloat (in the case of added entities, where the key properties must already be present if they were selected). We need to clarify the 4.0 rules here as well, since the 4.01 spec covers both versions. Need to review both the 4.0 and 4.01 text for compatibility

      Description

      https://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_AddedChangedEntity

      Text states:

      • Added entities MUST include all available selected properties and MAY include additional, unselected properties. Collection-valued properties are treated as atomic values; any collection-valued properties returned from a delta request MUST contain all current values for that collection.
      • Changed entities MUST include all available selected properties that have changed, and MAY include additional properties.

      Nowhere in the prose does it state that "id" control information must be included for added/changed entities (as compared with, in particular, providing the key properties). The non-normative example 32 shows the use of "@id" (V4.01) for a changed entity. There aren't any examples for added entities.

      Contrast this with section 15.3 Deleted Entity:

      "In OData 4.01 payloads the deleted-entity object MUST include the following properties, regardless of the specified metadata value: ... Control information id or all of the entity’s key fields."

      For consistency between added/changed entities and deleted entities, perhaps added/changed entities could similarly require: "Control information id or all of the entity’s key fields".

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: