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

Add ability to annotate collections to return only count and NextLink

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: No Action
    • Affects Version/s: V4.0_CSD01
    • Fix Version/s: V4.01_CS02
    • Component/s: Protocol, Vocabularies
    • Labels:
      None
    • Environment:

      V4.01

    • Proposal:
      Hide

      ----------------
      Add new example to Prefer header to showing use of count and navigation links
      --------------------
      To OData Version 4.01. Part 1: Protocol, clause 8.2.8.4 Preference include-annotations (odata.include-annotations)
      Add:
      Example 8: a Prefer header requesting that navigation links be returned in the case that the format metadata=minimal is specified in the Accept header.
      Prefer: include-annotations="odata.navigationLink,odata.count"

      Add paragraph before example 3.
      Regardless of the metadata format specified, annotations specified by the include-annotations preference should be added to response.

      --------------------
      Example:

      ------------------
      Proposed schema
      <EntityType Name="Top">

      <NavigationProperty Name="Systems" Type="Collection(ComputerSystem)"/>

      </EntityType>
      ----------
      Example: GET

      GET /redfish/v1/Top
      Prefer: include-annotations="odata.count,odata.navigationLink"

      Response
      Preferences-Applied: include-annotations="odata.count,odata.navigationLink"
      {
      "@odata.context": "/redfish/v1/$metadata#Top",
      "@odata.id": "/redfish/v1/Top",
      "@odata.type": "#Top ",
      "Name": "Top",

      "Systems@odata.count": 15,
      "Systems@odata.navigationLink":

      {"/redfish/v1/Systems"}



      }

      Show
      ---------------- Add new example to Prefer header to showing use of count and navigation links -------------------- To OData Version 4.01. Part 1: Protocol, clause 8.2.8.4 Preference include-annotations (odata.include-annotations) Add: Example 8: a Prefer header requesting that navigation links be returned in the case that the format metadata=minimal is specified in the Accept header. Prefer: include-annotations="odata.navigationLink,odata.count" Add paragraph before example 3. Regardless of the metadata format specified, annotations specified by the include-annotations preference should be added to response. -------------------- Example: ------------------ Proposed schema <EntityType Name="Top"> … <NavigationProperty Name="Systems" Type="Collection(ComputerSystem)"/> … </EntityType> ---------- Example: GET GET /redfish/v1/Top Prefer: include-annotations="odata.count,odata.navigationLink" Response Preferences-Applied: include-annotations="odata.count,odata.navigationLink" { "@odata.context": "/redfish/v1/$metadata#Top", "@odata.id": "/redfish/v1/Top", "@odata.type": "#Top ", "Name": "Top", … "Systems@odata.count": 15, "Systems@odata.navigationLink": {"/redfish/v1/Systems"} … }
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/commit/4993792bb98879012be9bd7f719e6541e5012620

      Description

      Issues with NavigationProperty
      1) If AutoExpand or AutoExpandReferences is not specified, then a GET without $expand or $ref query parameters will not return any representation of declared NavigationProperties.
      2) If AutoExpand or AutoExpandReferences is specified, the concern is that the returned representation of the containing entity might be too large.
      3) For an EntityType containing many NavigationProperties, it is difficult to specify the desired information using query parameters.

      The Redfish specification attempts to solve these issues by introducing an intermediate resource that contains the original collection as a Members collection. The intermediate resource is then referenced via a NavigationProperty with AutoExpandReferences. The new resource is required to return $count as a metadata property of the Members collection. The value is the size of the original collection.

      For the most part, this is successful, but the solution creates several new problems.
      1) Redfish specifies that a POST to the intermediate resource is equivalent to doing a POST to the contained collection. This is not conformant.
      2) Introduction of many intermediate resources makes the resulting model more complex.

        Attachments

          Activity

            People

            • Assignee:
              george.ericson George Ericson
              Reporter:
              george.ericson George Ericson
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: