Skip to content

Commit

Permalink
Improve abnf; add test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepizzo committed Jul 26, 2023
1 parent dea100d commit 235490c
Show file tree
Hide file tree
Showing 4 changed files with 838 additions and 971 deletions.
70 changes: 19 additions & 51 deletions docs/rsdl/rapid-rsdl-abnf.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,61 +161,29 @@ collectionNavigationCapabilities = "{" OWS [ collectionNavigationCapability *( s
```ABNF
paths = %s"paths" OWS "{" *( OWS "/" path ) OWS "}"
path = serviceOperationSegment [ ( RWS serviceOperationCapabilities ) / ( *( "/" interimSegment ) "/" lastSegment ) ]
/ identifier [ "/" castSegment ] [ ( RWS collectionNavPathCapabilities ) / ( "/" keySegment [ ( RWS singleNavPathCapabilities / ( *( "/" interimSegment ) "/" lastSegment ) ) ] ) ]
/ identifier [ "/" castSegment ] [ ( RWS singleNavPathCapabilities ) / ( *( "/" interimSegment ) "/" lastSegment ) ]
interimSegment = collectionNavSegment "/" keySegment
/ serviceOperationSegment
/ castSegment
/ singleValuedSegment
/ singleNavSegment
lastSegment = serviceOperationSegment [ RWS serviceOperationCapabilities ]
/ singleValuedSegment [ "/" castSegment ] [ RWS singlePathCapabilities ]
/ collectionValuedSegment [ "/" castSegment ] [ RWS collectionPathCapabilities ]
/ singleNavSegment [ "/" castSegment ] [ RWS singleNavPathCapabilities ]
/ collectionNavSegment [ "/" castSegment ] [ RWS ( collectionNavPathCapabilities / "/" keySegment RWS singleNavPathCapabilities )]
path = propertySegment "/" keySegment [ pathSegment / ( RWS singleNavPathCapabilities ) ]
/ serviceOperationSegment "/" keySegment [ pathSegment / ( RWS singleNavPathCapabilities ) ]
/ serviceOperationSegment [ pathSegment / ( RWS capabilities ) ]
/ castSegment [ pathSegment / collectionPathCapabilities / ( RWS collectionNavPathCapabilities ) ]
/ propertySegment [ pathSegment / ( RWS capabilities ) ]
serviceOperationSegment = identifier parameters [ "/" castSegment ] [ "/" keySegment ]
serviceOperationCapabilities = singlePathCapabilities / collectionPathCapabilities / singleNavPathCapabilities / collectionNavPathCapabilities
singleValuedSegment = identifier ; a single property
/ singleValuedOperation
collectionValuedSegment = identifier ; a collection-valued property
/ collectionValuedOperation
propertySegment = identifier; structural or navigation property
singleNavSegment = identifier ; a single navigation property
/ singleNavigationProperty
/ singleNavValuedOperation
pathSegment = "/" path
collectionNavSegment = identifier ; a collection-valued navigation property
/ collectionNavigationProperty
/ collectionNavValuedOperation
castSegment = identifier 1*( "." identifier ) ; qualified type name
singleValuedOperation = identifier ; an operation that returns a single value
collectionValuedOperation = identifier ; an operation that returns a collection value
keySegment = "{" keyProperty "}"
singleNavValuedOperation = identifier ; an operation that returns a single navigation value
keyProperty = identifier ; name of the key property
collectionNavValuedOperation = identifier ; an operation that returns a collection of navigation values
serviceOperationSegment = identifier parameters [ "/" castSegment ] [ "/" keySegment ]
parameters = "(" OWS parameterSpecification *( "," OWS parameterSpecification ) OWS ")"
parameterSpecification = identifier OWS "=" OWS "{" identifier "}"
castSegment = identifier 1*( "." identifier )
keySegment = "{" keyProperty "}"
keyProperty = identifier ; name of the key property
singleNavigationProperty = identifier ; a single valued navigation property
collectionNavigationProperty = identifier ; a collection valued navigation property
capabilities = singlePathCapabilities / collectionPathCapabilities / singleNavPathCapabilities / collectionNavPathCapabilities
```

Expand All @@ -225,19 +193,19 @@ collectionNavigationProperty = identifier ; a collection valued navigat
singlePathCapability = ("GET" / "PUT" / "PATCH" / "DELETE") [noOptions]
singlePathCapabilities = "{" [singlePathCapability *( separator singlePathCapability)] "}"
singlePathCapabilities = "{" OWS [singlePathCapability *( separator singlePathCapability) OWS] "}"
collectionPathCapability = "GET" [ collectionCapabilities ] / "POST" [noOptions]
collectionPathCapabilities = "{" [ collectionPathCapability *( separator collectionPathCapability )] "}"
collectionPathCapabilities = "{" OWS [ collectionPathCapability *( separator collectionPathCapability ) OWS ] "}"
singleNavPathCapability = ("GET" / "PATCH" / "PUT") [ OWS navCapabilities ] / "DELETE" noOptions
singleNavPathCapabilities = "{" [singleNavPathCapability *( separator singleNavPathCapability )] "}"
singleNavPathCapabilities = "{" OWS [singleNavPathCapability *( separator singleNavPathCapability ) OWS ] "}"
collectionNavPathCapability = "GET" [ OWS collectionNavCapabilities ] / "POST" [ OWS navCapabilities ]
collectionNavPathCapabilities = "{" [ collectionNavPathCapability *( separator collectionNavPathCapability )] "}"
collectionNavPathCapabilities = "{" OWS [ collectionNavPathCapability *( separator collectionNavPathCapability ) OWS ] "}"
```

Expand All @@ -257,9 +225,9 @@ navCapability = "expand" [ OWS "(" OWS [ expandProperty *( OWS "," OWS exp
navCapabilities = "{" OWS [ navCapability OWS ] "}"
expandProperty = star /
[ castSegment "/" ] collectionNavigationProperty [ OWS collectionNavCapabilities ] /
[ castSegment "/" ] ( singleNavigationProperty ) [ OWS navCapabilities ]
expandProperty = star / [ castSegment "/" ] navigationProperty ( [ OWS collectionNavCapabilities ] / [ OWS navCapabilities ] )
navigationProperty = identifier ; single or collection valued navigation property
filterCapability = "filter" [ "(" [ OWS filterProperty *( "," OWS filterProperty OWS ) ] ")" ]
Expand Down
Loading

0 comments on commit 235490c

Please sign in to comment.