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
Copy file name to clipboardExpand all lines: docs/syntax.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,6 @@ This is a list of things that you might find in other JSONPath implementation th
199
199
- We do not support arithmetic in filter expression.
200
200
- We don't allow dotted array indices. An array index must be surrounded by square brackets.
201
201
- Python JSONPath is strictly read only. There are no update "selectors", but we do provide methods for converting `JSONPathMatch` instances to `JSONPointer`s, and a `JSONPatch` builder API for modifying JSON-like data structures using said pointers.
202
-
- We don't attempt to handle JSON documents without a top-level array or object (or equivalent Python objects).
203
202
204
203
And this is a list of areas where we deviate from [RFC 9535](https://datatracker.ietf.org/doc/html/rfc9535).
205
204
@@ -209,14 +208,18 @@ And this is a list of areas where we deviate from [RFC 9535](https://datatracker
209
208
- We don't require the recursive descent segment to have a selector. `$..` is equivalent to `$..*`.
210
209
- We support explicit comparisons to `undefined` as well as implicit existence tests.
211
210
- Float literals without a fractional digit are OK. `1.` is equivalent to `1.0`.
212
-
- We treat literals (such as `true` and `false`) as valid "basic" expressions. So `$[?true || false]` does not raise a syntax error, which is and invalid query according to RFC 9535.
211
+
- We treat literals (such as `true` and `false`) as valid "basic" expressions. For example, `$[?true || false]`, without an existence test or comparison either side of logical _or_, does not raise a syntax error.
212
+
- By default, `and` is equivalent to `&&` and `or` is equivalent to `||`.
213
+
-`none` and `nil` are aliases for `null`.
214
+
-`null` (and its aliases), `true` and `false` can start with an upper or lower case letter.
213
215
214
216
And this is a list of features that are uncommon or unique to Python JSONPath.
215
217
216
218
- We support membership operators `in` and `contains`, plus list/array literals.
217
219
-`|` is a union operator, where matches from two or more JSONPaths are combined. This is not part of the Python API, but built-in to the JSONPath syntax.
218
220
-`&` is an intersection operator, where we exclude matches that don't exist in both left and right paths. This is not part of the Python API, but built-in to the JSONPath syntax.
219
221
-`#` is the current key/property or index identifier when filtering a mapping or sequence.
220
-
-`_` is a filter context selector. With usage similar to `$` and `@`, `_` exposes arbitrary data from the `filter_context` argument to `findall()` and `finditer()`.
222
+
-`_` is a filter context identifier. With usage similar to `$` and `@`, `_` exposes arbitrary data from the `filter_context` argument to `findall()` and `finditer()`.
221
223
-`~` is a "keys" or "properties" selector.
222
224
-`^` is a "fake root" identifier. It is equivalent to `$`, but wraps the target JSON document in a single-element array, so the root value can be conditionally selected with a filter selector.
225
+
-`=~` is the the regex match operator, matching a value to a JavaScript-style regex literal.
0 commit comments