You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Example Lines of Code for a Custom Parser](https://gist.github.com/jirutka/42a0f9bfea280b3c5dca) for Java Persistence API (JPA)
578
578
579
+
By default, all operators except `=isnull=`**MUST** exclude fields with NULL values from the results. This mirrors the behavior of SQL, where expressions involving NULL evaluate to unknown and are therefore not returned in comparison-based queries.
580
+
581
+
To explicitly filter for NULL values, add the `=isnull=` operator with either true or false.
582
+
579
583
It is not mandatory to support all operators listed in the table below as this document is about syntax and convention. Any API may support just a subset of given operators or provide additional operators if needed.
580
584
581
-
| Filter | Operator | Standard | Example | Notes |
582
-
| ------ | -------- | -------- |-------| ----- |
585
+
| Filter | Operator | Standard | Example | Notes |
| Equals |`==`| FIQL | someKey==value<br />someKey==*value<br />someKey==value*<br />someKey==*value*<br />someKey==*va*ue*<br />someKey=="Should be quoted if a value contains whitespaces or any reserved characters" | Allowed to use wildcard symbol '*' at the beginning, at the end, in the middle, or in multiple places of a string to represent 'ends with', 'starts with', 'contains', or 'like' functions. An endpoint should provide documentation about wildcard usage and the default case. |
584
-
| Not Equals |`!=`| FIQL | someKey!=value<br />someKey!=*value<br />someKey!=value*<br />someKey!=*value*<br />someKey!=*va*ue*| Allowed to use wildcard symbol '*' at the beginning, at the end, in the middle, or in multiple places of a string to represent 'not ends with', 'not starts with', 'not contains', 'not like' functions. An endpoint should provide documentation about wildcard usage and the default case. |
585
-
| Less Than |`=lt=`| FIQL | someKey=lt=42 | < |
586
-
| Less Than or Equals |`=le=`| FIQL | someKey=le=42 | <= |
587
-
| Greater Than |`=gt=`| FIQL | someKey=gt=42 | > |
588
-
| Greater Than or Equals |`=ge=`| FIQL | someKey=ge=42 | >= |
589
-
| In |`=in=`| RSQL | someKey=in=(1,2,3) | Can be added as a custom function to any FIQL library if you can't find any RSQL compatible library for your platform |
590
-
| Not In |`=out=`| RSQL | someKey=out=(1,2,3) | Can be added as a custom function to any FIQL library if you can't find any RSQL compatible library for your platform |
591
-
| Is NULL |`=isnull=`| Custom | someKey=isnull=true | If API requires NULL check then this operator should be used. |
592
-
| String Operators | =contains=<br />=containsic=<br />=startswith=<br />=startswithic=<br />=endswith=<br />=endswithic=<br />=like=<br />=notlike=<br />=likeic=<br />=notlikeic=<br /> | Custom | someKey=contains=VALUE<br />case sensitive check as the given function doesn't have 'ic' suffix, where 'ic' means "ignoring case" | If API requires special handling for strings it is allowed to provide a custom operator with or without the 'ic' suffix to support advanced string filtering. It is the responsibility of the implementor to maintain consistency between wildcards used with 'Equals' and 'Not Equals' operators and custom functions. |
588
+
| Not Equals |`!=`| FIQL | someKey!=value<br />someKey!=*value<br />someKey!=value*<br />someKey!=*value*<br />someKey!=*va*ue*| Allowed to use wildcard symbol '*' at the beginning, at the end, in the middle, or in multiple places of a string to represent 'not ends with', 'not starts with', 'not contains', 'not like' functions. An endpoint should provide documentation about wildcard usage and the default case. |
589
+
| Less Than |`=lt=`| FIQL | someKey=lt=42 | < |
590
+
| Less Than or Equals |`=le=`| FIQL | someKey=le=42 | <= |
591
+
| Greater Than |`=gt=`| FIQL | someKey=gt=42 | > |
592
+
| Greater Than or Equals |`=ge=`| FIQL | someKey=ge=42 | >= |
593
+
| In |`=in=`| RSQL | someKey=in=(1,2,3) | Can be added as a custom function to any FIQL library if you can't find any RSQL compatible library for your platform |
594
+
| Not In |`=out=`| RSQL | someKey=out=(1,2,3) | Can be added as a custom function to any FIQL library if you can't find any RSQL compatible library for your platform |
595
+
| Is NULL |`=isnull=`| Custom | someKey=isnull=true<br/>someKey=isnull=false | If API requires NULL check then this operator should be used. |
596
+
| String Operators | =contains=<br />=containsic=<br />=startswith=<br />=startswithic=<br />=endswith=<br />=endswithic=<br />=like=<br />=notlike=<br />=likeic=<br />=notlikeic=<br /> | Custom | someKey=contains=VALUE<br />case sensitive check as the given function doesn't have 'ic' suffix, where 'ic' means "ignoring case" | If API requires special handling for strings it is allowed to provide a custom operator with or without the 'ic' suffix to support advanced string filtering. It is the responsibility of the implementor to maintain consistency between wildcards used with 'Equals' and 'Not Equals' operators and custom functions. |
593
597
594
598
```warning
595
599
The dynamic nature of filters means that all fields cannot be listed in Open API specifications because there could be dozens for a single endpoint depending on the level of nesting in the response. Instead, Open API specification may contain generic information about the supported filtering approach, the list of allowed operators, examples, and other information that may be helpful for a user.
Processing of `ETag` and associated validation headers should be consistent with the [Request Response](request-response.md#etag) section, returning appropriate status codes as needed.
683
+
Processing of `ETag` and associated validation headers should be consistent with the [Request Response](request-response.md#etag) section, returning appropriate status codes as needed.
0 commit comments