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

Correct examples 53, 54, and 61

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS02
    • Fix Version/s: V4.0_CSD04
    • Component/s: Data Aggregation
    • Labels:
    • Environment:

      Applied

    • Proposal:
      Hide
      1. Updates to sections 3.1 and 3.1.1 in the specification: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/67246/ODATA-945%20-%20Proposal%20for%20Spec%20Update.docx
      2. Update examples in document:

      Replace response payload of example 53 with

      {
      "@odata.context": "$metadata#Products(Name,Total)",
      "value": [

      { "@odata.id": null, "Name": "Coffee", "Total": 12 }

      ,

      { "@odata.id": null, "Name": "Paper", "Total": 8 }

      ,

      { "@odata.id": null, "Name": "Pencil", "Total": null }

      ,

      { "@odata.id": null, "Name": "Sugar", "Total": 4 }

      ]
      }

      Example 54: Modify request to properly reflect the nesting shown in the response:
      GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),
      aggregate(Sales(Amount with sum as Total)))

      Correct Example 61 as

      { "Name": "Coffee", "Forecast": 6, "Sales": [ { "Actual": 12 } ] }
      
      Show
      Updates to sections 3.1 and 3.1.1 in the specification: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/67246/ODATA-945%20-%20Proposal%20for%20Spec%20Update.docx Update examples in document: Replace response payload of example 53 with { "@odata.context": "$metadata#Products(Name,Total)", "value": [ { "@odata.id": null, "Name": "Coffee", "Total": 12 } , { "@odata.id": null, "Name": "Paper", "Total": 8 } , { "@odata.id": null, "Name": "Pencil", "Total": null } , { "@odata.id": null, "Name": "Sugar", "Total": 4 } ] } Example 54: Modify request to properly reflect the nesting shown in the response: GET ~/Products?$apply=groupby((Name,Sales/Currency/Code), aggregate(Sales(Amount with sum as Total))) Correct Example 61 as { "Name" : "Coffee" , "Forecast" : 6, "Sales" : [ { "Actual" : 12 } ] }

      Description

      Example 53 requests aggregation of property path Sales/Amount, but the response shows the dynamic property Total nested inside Sales. Rightly, it should have been “added to the type containing the original expression” (section 3.1.1).
      In example 54, the response payload shows the dynamic property Total nested within Sales. According to the request, which uses the path expression Sales/Amount for aggregation, the Total property should be at the top level.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gerald.krause1 Gerald Krause
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: