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: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# Python JSONPath Change Log
2
2
3
+
## Version 0.11.0 (unreleased)
4
+
5
+
**Fixes**
6
+
7
+
- The lexer now sorts environment-controlled tokens by their length in descending order. This allows one custom token to be a prefix of another.
8
+
9
+
**Features**
10
+
11
+
- Added the non-standard "fake root" identifier, which defaults to `^` and can be customized with the `fake_root_token` attribute on a `JSONPathEnvironment` subclass. Using the fake root identifier is equivalent to the standard root identifier (`$`), but wraps the target JSON value in an array, so the root value can be conditionally selected using a filter.
12
+
- Non-standard environment-controlled tokens can now be disabled by setting them to the empty string.
This non-standard "fake root" identifier behaves like the standard root identifier (`$`), but wraps the target JSON document in a single-element array, so as to make it selectable with a filter selector.
170
+
171
+
```text
172
+
^[?length(categories) > 0]
173
+
```
174
+
165
175
### Union (`|`) and intersection (`&`)
166
176
167
177
Union (`|`) and intersection (`&`) are similar to Python's set operations, but we don't dedupe the matches (matches will often contain unhashable objects).
@@ -209,3 +219,4 @@ And this is a list of features that are uncommon or unique to Python JSONPath.
209
219
-`#` is the current key/property or index identifier when filtering a mapping or sequence.
210
220
-`_` is a filter context selector. With usage similar to `$` and `@`, `_` exposes arbitrary data from the `filter_context` argument to `findall()` and `finditer()`.
211
221
-`~` is a "keys" or "properties" selector.
222
+
-`^` 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.
0 commit comments