-
Type: Improvement
-
Status: New
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: V4.01_OS
-
Fix Version/s: V4.02
-
Component/s: JSON Format
-
Labels:None
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"} ] } }