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

Expressions in action payloads

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02_WD01
    • Component/s: JSON Format
    • Labels:
      None

      Description

      Use case

      The history of department D15 (example data from [OData-Temporal]) shall be merged into D08. Assume we already have a function toTimeslices that converts Departments('D15')/history into the TimesliceWithPeriod format so that

      GET ~/Departments('D15')/history/Temporal.toTimeslices()
      

      returns

      [{"Timeslice": {
         "From""2010-01-01",
         "To""2011-01-01",
         "Name": "Services",
         "Budget": 1100
      }},
       {"Timeslice": {
         "From""2011-01-01",
         "To""9999-12-31",
         "Name""Services",
         "Budget": 1700
      }}]
      

      If action parameters were specified in the URL, one could write:

      POST ~/Departments('D08')/history/Temporal.Update(deltaTimeslices=@delta)
      &@delta=$root/Departments('D15')/history/Temporal.toTimeslices()
      

      But action parameters must be passed in the payload, and this does not allow aliases and expressions.

      Suggestion

      POST ~/Departments('D08')/history/Temporal.Update
      
      {
       "deltaTimeslices@expressionUrl":
        "$root/Departments('D15')/history/Temporal.toTimeslices()"
      }
      

      Or, because in a structured payload, a structured expression fits better than an expression string that must be parsed, we borrow notation from CSDL:

      POST ~/Departments('D08')/history/Temporal.Update
      
      {
       "deltaTimeslices@expressionCsdl": {
        "$Function": "Temporal.toTimeslices",
        "$Apply": [
         {"$Path": "$root/Departments('D15')/history"}
        ]
       }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: