diff --git a/abnf/odata-abnf-construction-rules.txt b/abnf/odata-abnf-construction-rules.txt index a29639e..0967a97 100644 --- a/abnf/odata-abnf-construction-rules.txt +++ b/abnf/odata-abnf-construction-rules.txt @@ -331,7 +331,7 @@ inlinecount = ( "$count" / "count" ) EQ booleanValue schemaversion = ( "$schemaversion" / "schemaversion" ) EQ ( STAR / 1*unreserved ) -search = ( "$search" / "search" ) EQ BWS ( searchExpr / searchExpr-incomplete ) +search = ( "$search" / "search" ) EQ BWS ( searchExpr / searchExpr-incomplete ) BWS searchExpr = ( searchParenExpr / searchNegateExpr @@ -359,7 +359,7 @@ searchPhrase = quotation-mark 1*( qchar-no-AMP-DQUOTE / SP ) quotation-mark ; Expressing this in ABNF is somewhat clumsy, so the following rule is overly generous. ; Note: the words AND, OR, and NOT are sometimes operators, depending on their position within a search expression. searchWord = searchChar *( searchChar / SQUOTE ) -searchChar = unreserved / pct-encoded-no-DQUOTE / "!" / "*" / "+" / "," / ":" / "@" / "/" / "?" / "$" / "=" +searchChar = unreserved / pct-encoded-no-SP-DQUOTE / "!" / "*" / "+" / "," / ":" / "@" / "/" / "?" / "$" / "=" searchExpr-incomplete = SQUOTE *( SQUOTE-in-string / qchar-no-AMP-SQUOTE / quotation-mark / SP ) SQUOTE @@ -1238,6 +1238,9 @@ pct-encoded-unescaped = "%" ( "0" / "1" / "3" / "4" / "6" / "7" / "8" / "9" pct-encoded-no-DQUOTE = "%" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) HEXDIG / "%" "2" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) +pct-encoded-no-SP-DQUOTE = "%" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) HEXDIG + / "%" "2" ( "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) + ;------------------------------------------------------------------------------ ; B. IRI syntax [RFC3987] diff --git a/abnf/odata-abnf-testcases.yaml b/abnf/odata-abnf-testcases.yaml index b9265be..736c0b5 100644 --- a/abnf/odata-abnf-testcases.yaml +++ b/abnf/odata-abnf-testcases.yaml @@ -2695,6 +2695,26 @@ TestCases: Rule: queryOptions Input: $search=blue%20green + - Name: 5.1.7 Search - leading space + Rule: queryOptions + Input: $search=%20blue + Expect: + - searchWord:blue + + - Name: 5.1.7 Search - trailing space + Rule: queryOptions + Input: $search=blue%20&!special + Expect: + - searchWord:blue + - customQueryOption:!special + + - Name: 5.1.7 Search - space in search phrase + Rule: queryOptions + Input: $search=%20"%20"%20-%20 + Expect: + - searchPhrase:"%20" + - searchWord:- + - Name: 5.1.7 Search - AND Rule: queryOptions Input: $search=blue AND green diff --git a/package-lock.json b/package-lock.json index 661cef2..4b81d12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "odata-abnf", "version": "0.0.0", - "license": "ISC", + "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "apg-js": "^4.2.0", "colors": "^1.4.0",