Skip to content

Commit

Permalink
Request references (#117)
Browse files Browse the repository at this point in the history
* $<request-id>

* TC 2024-05-08

* additional test cases
  • Loading branch information
HeikoTheissen authored May 29, 2024
1 parent 7f529f2 commit c4df667
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions abnf/odata-abnf-construction-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ rootExpr = %s"$root/" ( entitySetName [ collectionNavigationExpr ]

firstMemberExpr = memberExpr
/ inscopeVariableExpr [ "/" memberExpr ]
/ "$" request-id "/" memberExpr ; reference to single-valued response of earlier request
/ "$" request-id collectionNavigationExpr ; reference to collection-valued response of earlier request
/ "$" request-id

memberExpr = directMemberExpr
/ ( optionallyQualifiedEntityTypeName / optionallyQualifiedComplexTypeName ) "/" directMemberExpr
Expand Down
24 changes: 24 additions & 0 deletions abnf/odata-abnf-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ Constraints:
- Title
- X
- ZipCode
request-id:
- '1'
- First-Insert~Customer_1.1
- group1
singletonEntity:
- BestProductEverCreated
- MainSupplier
Expand Down Expand Up @@ -2269,6 +2273,26 @@ TestCases:
Rule: odataRelativeUri
Input: Customers?$select=Addresses(@a=$this;$filter=endswith(@a/Street,'gasse'))

- Name: request reference in $batch
Rule: commonExpr
Input: Customer eq $1
Expect:
- firstMemberExpr:Customer
- firstMemberExpr:$1

- Name: property reference in $batch
Rule: commonExpr
Input: Customer/Name eq $1/Name
Expect:
- memberExpr:Customer/Name
- memberExpr:Name

- Name: member reference in $batch
Rule: commonExpr
Input: Customer/Name eq $1('ALFKI')/Name
Expect:
- collectionNavigationExpr:('ALFKI')/Name

- Name: 5.1.1.15 Path expressions
Rule: commonExpr
Input: Items
Expand Down
2 changes: 2 additions & 0 deletions abnf/odata-aggregation-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ Constraints:
- Total # dynamic
- WeightedAmount # dynamic
- Year
request-id:
- group1
streamProperty:
- Image
termName:
Expand Down

0 comments on commit c4df667

Please sign in to comment.