Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODATA-1583 #106

Merged
merged 21 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 23 additions & 5 deletions abnf/odata-abnf-construction-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,34 @@ contextFragment = %s"Collection($ref)"
/ singletonEntity [ navigation *( containmentNavigation ) [ "/" qualifiedEntityTypeName ] ] [ selectList ]
/ qualifiedTypeName [ selectList ]
/ entitySet ( %s"/$deletedEntity" / %s"/$link" / %s"/$deletedLink" )
/ entitySet keyPredicate "/" contextPropertyPath [ selectList ]
/ entitySet contextKeyPredicate "/" contextPropertyPath [ selectList ]
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved
/ entitySet [ selectList ] [ %s"/$entity" / %s"/$delta" ]

entitySet = entitySetName *( containmentNavigation ) [ "/" qualifiedEntityTypeName ]

containmentNavigation = keyPredicate [ "/" qualifiedEntityTypeName ] navigation
containmentNavigation = contextKeyPredicate [ "/" qualifiedEntityTypeName ] navigation
navigation = *( "/" complexProperty [ "/" qualifiedComplexTypeName ] ) "/" navigationProperty

selectList = OPEN [ selectListItem *( COMMA selectListItem ) ] CLOSE
selectListItem = STAR ; all structural properties
contextKeyPredicate = "(" ( contextKeyValue / contextKeyValuePair *( "," contextKeyValuePair ) ) ")"
contextKeyValuePair = ( primitiveKeyProperty / keyPropertyAlias ) EQ contextKeyValue
contextKeyValue = boolean
/ guid
/ dateTimeOffsetValue
/ date
/ timeOfDayValue
/ decimalValue
/ sbyteValue
/ byte
/ int16Value
/ int32Value
/ int64Value
/ stringValue
/ durationValue
/ enumValue
stringValue = %x27 *( %x00-26 / %x27 %x27 / %x28-FF) %x27 ; SQUOTE = %x27
HeikoTheissen marked this conversation as resolved.
Show resolved Hide resolved
HeikoTheissen marked this conversation as resolved.
Show resolved Hide resolved

selectList = "(" [ selectListItem *( "," selectListItem ) ] ")"
selectListItem = "*" ; all structural properties
/ allOperationsInSchema
/ [ ( qualifiedEntityTypeName / qualifiedComplexTypeName ) "/" ]
( qualifiedActionName
Expand All @@ -469,7 +487,7 @@ contextPropertyPath = primitiveProperty
/ complexProperty [ [ "/" qualifiedComplexTypeName ] "/" contextPropertyPath ]

qualifiedActionName = namespace "." action
qualifiedFunctionName = namespace "." function [ OPEN parameterNames CLOSE ]
qualifiedFunctionName = namespace "." function [ "(" parameterName *( "," parameterName ) ")" ]

complexAnnotationInFragment = annotationInFragment ; complex-valued annotation
entityAnnotationInFragment = annotationInFragment ; entity-valued annotation
Expand Down
28 changes: 28 additions & 0 deletions abnf/odata-abnf-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Constraints:
- ProductsByCustomer
- ProductsOrderedBy
entityColNavigationProperty:
- Details
- DirectReports
- Items
- Orders
Expand Down Expand Up @@ -3363,6 +3364,21 @@ TestCases:
Rule: context
Input: "#Customers(Address/Country)"

- Name: Context URL - no percent-encoding allowed
Rule: context
FailAt: 18
Input: "#Customers(Address%2FStreet)"

- Name: Context URL - no percent-encoding allowed
Rule: context
FailAt: 18
Input: "#Customers(Address%2COrders)"

- Name: Context URL - no percent-encoding allowed
Rule: context
FailAt: 10
Input: "#Customers%28Address,Orders)"

- Name: Context URL - Entity set with $select and type-cast
Rule: context
Input: "#Customers(Address/Model.AddressWithLocation,Orders)"
Expand Down Expand Up @@ -3463,10 +3479,22 @@ TestCases:
Rule: context
Input: "#Customers('ALFKI')/Orders"

- Name: Context URL - collection with containment, key value without percent-encoding
Rule: context
Input: "#Customers('ALF/KI')/Orders"
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved

- Name: Context URL - collection with containment, key value without percent-encoding
Rule: context
Input: "#Customers('%')/Orders"

- Name: Context URL - containment
Rule: context
Input: "#Customers('ALFKI')/Orders/$entity"

- Name: Context URL - containment - multi-part key
Rule: context
Input: "#OrderItems(OrderID=1,ItemID='a')/Details/$entity"

- Name: Context URL - collection with containment - multi-level
Rule: context
Input: "#Customers('ALFKI')/Orders(1)/Items"
Expand Down