Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1283

$search: ABNF comment is more restrictive than prose text

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS01
    • Fix Version/s: V4.01_CS02
    • Component/s: ABNF
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      Adapt ABNF comment accordingly to allow
       

      $search=AND
      $search=OR
      $search=OR ELSE
      $search=NOT

      Note: it would be sufficient to allow AND, OR, and NOT as search words if they appear alone. Use case triggering this issue is type-ahead: a user slowly typing NOTE into a search field can trigger bad requests if the UI fires $search=NO, $search=NOT, $search=NOTE while the user is typing.

       

      Show
      Adapt ABNF comment accordingly to allow   $search=AND $search=OR $search=OR ELSE $search=NOT Note: it would be sufficient to allow AND, OR, and NOT as search words if they appear alone. Use case triggering this issue is type-ahead: a user slowly typing NOTE into a search field can trigger bad requests if the UI fires $search=NO , $search=NOT , $search=NOTE  while the user is typing.  
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-abnf/pull/17

      Description

      ABNF line 347 states

      ; The words AND, OR, and NOT are not a valid searchWord.
      

      This is more restrictive than the corresponding prose text (bold parts for later reference below):

      The search expression can contain any number of terms, phrases, or group expressions, along with the case-sensitive keywords NOT, AND, and OR, evaluated in that order.

      Expressions prefaced with NOT evaluate to true if the expression is not matched, otherwise false.

      Two expressions not enclosed in quotes and separated by a space are equivalent to the same two expressions separated by the AND keyword. Such expressions evaluate to true if both of the expressions evaluate to true, otherwise false.

      Expressions separated by an OR evaluate to true if either of the expressions evaluate to true, otherwise false.

       
      The prose text would allow using the words AND and OR as the first search word in an expression because the operators separate search expressions, and NOT as the only search word because the operator prefaces an expression.
       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: