balena-io-modules / pinejs-client-js

4 stars 4 forks source link

Fix $count typings to only allow $filter under it #128

Closed thgreasi closed 2 years ago

thgreasi commented 2 years ago

Afaict this is not allowed and odata-to-abstractsql ignores the extras props:

expandPath        = *( ( complexProperty / complexColProperty / optionallyQualifiedComplexTypeName / complexAnnotationInQuery ) "/" )
                    ( STAR [ ref / OPEN levels CLOSE ]
                    / streamProperty 
                    / ( navigationProperty / entityAnnotationInQuery ) [ "/" optionallyQualifiedEntityTypeName ] 
                      [ ref   [ OPEN expandRefOption   *( SEMI expandRefOption   ) CLOSE ] // <========
                      / count [ OPEN expandCountOption *( SEMI expandCountOption ) CLOSE ]
                      /         OPEN expandOption      *( SEMI expandOption      ) CLOSE 
                      ]
                    )

collectionPathExpr = count [ OPEN expandCountOption *( SEMI expandCountOption ) CLOSE ] // // <========
                   / filterExpr [ collectionPathExpr ]
                   / "/" anyExpr
                   / "/" allExpr
                   / "/" boundFunctionExpr
                   / "/" annotationExpr

expandCountOption = filter
                  / search

Change-type: patch See: https://docs.oasis-open.org/odata/odata/v4.01/os/abnf/odata-abnf-construction-rules.txt Signed-off-by: Thodoris Greasidis thodoris@balena.io