Skip to content
Draft
5 changes: 4 additions & 1 deletion abnf/odata-abnf-construction-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ orderbyItem = commonExpr [ RWS ( "asc" / "desc" ) ]
skip = ( "$skip" / "skip" ) EQ 1*DIGIT
top = ( "$top" / "top" ) EQ 1*DIGIT

index = ( "$index" / "index" ) EQ [ "-" ] 1*DIGIT
index = ( "$index" / "index" ) EQ indexExpr

format = ( "$format" / "format" ) EQ
( "atom"
Expand Down Expand Up @@ -567,12 +567,15 @@ collectionPathExpr = count [ OPEN expandCountOption *( SEMI expandCountOption )
/ "/" allExpr
/ "/" boundFunctionExpr
/ "/" annotationExpr
/ "/" indexExpr [ complexPathExpr ]

complexPathExpr = "/" directMemberExpr
/ "/" optionallyQualifiedComplexTypeName [ "/" directMemberExpr ]

primitivePathExpr = "/" [ annotationExpr / boundFunctionExpr ]

indexExpr = [ "-" ] 1*DIGIT

boundFunctionExpr = functionExpr ; boundFunction segments can only be composed if the type of the
; previous segment matches the type of the first function parameter

Expand Down
12 changes: 12 additions & 0 deletions abnf/odata-abnf-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,18 @@ TestCases:
Rule: odataRelativeUri
Input: Suppliers(1)/Addresses/Model.AddressWithLocation/-1

- Name: 4.10 Addressing a Member of an Ordered Primitive Collection - in $orderby
Rule: orderby
Input: $orderby=EmailAddresses/1

- Name: 4.10 Addressing a Member of an Ordered Complex Collection - in $orderby
Rule: orderby
Input: $orderby=Addresses/0/Name

- Name: 4.10 Addressing a Member of an Ordered Complex Collection with type-cast - in $orderby
Rule: orderby
Input: $orderby=Addresses/Model.AddressWithLocation/-1/Location

- Name: 4.11 Inheritance - set of subtypes
Rule: odataRelativeUri
Input: Products/Model.BestSellingProduct
Expand Down