|
1 | 1 | # Python JSONPath Change Log |
2 | 2 |
|
| 3 | +## Version 2.0.0 (unreleased) |
| 4 | + |
| 5 | +**JSONPath syntax changes** |
| 6 | + |
| 7 | +These breaking changes apply to Python JSONPath in its default configuration. We've also introduced a _strict mode_ where we follow the RFC 9535 specification exactly. See [optional dependencies](https://jg-rp.github.io/python-jsonpath/#optional-dependencies) and the [syntax guide](https://jg-rp.github.io/python-jsonpath/syntax/) for more information. |
| 8 | + |
| 9 | +- Using bracket notation, unquoted property names are no longer equivalent to quoted property names. These paths used to be equivalent, `$[foo]`, `$['foo']` and `$["foo"]`. Now, names without quotes start a _singular query selector_. With an implicit _root identifier_, `$.a[b]` is equivalent to `$.a[$.b]`. See [Singular query selector](https://jg-rp.github.io/python-jsonpath/syntax/#singular-query-selector) in the syntax guide. |
| 10 | +- In filter selector expressions, float literals now follow the specification. Previously `.1` and `1.` where allowed, now it must be `0.1` and `1.0`, with at least one digit either side of the decimal point. |
| 11 | +- Slice selector indexes and step now follow the specification. Previously leading zeros and negative zero were allowed, now they raise a `JSONPathSyntaxError`. |
| 12 | +- Whitespace is no longer allowed between a dot (`.` or `..`) and a name when using shorthand notation for the name selector. Whitespace before the dot is OK. |
| 13 | + |
| 14 | +**JSONPath features** |
| 15 | + |
| 16 | +- Added the [Keys filter selector](https://jg-rp.github.io/python-jsonpath/syntax/#keys-filter-selector). |
| 17 | +- Added the [Singular query selector](https://jg-rp.github.io/python-jsonpath/syntax/#singular-query-selector). |
| 18 | +- Use the [regex] package, if available, instead of `re` for match and search function extensions. See [optional dependencies](https://jg-rp.github.io/python-jsonpath/#optional-dependencies). |
| 19 | +- Added the `strict` argument to all [convenience functions](https://jg-rp.github.io/python-jsonpath/convenience/), the CLI and the `JSONPathEnvironment` constructor. When `strict=True`, all extensions to RFC 9535 and any lax parsing rules will be disabled. |
| 20 | +- Added class variable `JSONPathEnvironment.max_recursion_depth` to control the maximum recursion depth of descendant segments. |
| 21 | +- Added pretty exception messages. |
| 22 | + |
| 23 | +**Python API changes** |
| 24 | + |
| 25 | +- Renamed class variable `JSONPathEnvironment.fake_root_token` to `JSONPathEnvironment.pseudo_root_token`. |
| 26 | + |
| 27 | +**Low level API changes** |
| 28 | + |
| 29 | +These breaking changes will only affect you if you're customizing the JSONPath lexer or parser. |
| 30 | + |
| 31 | +- The tokens produced by the JSONPath lexer have changed. Previously we broadly skipped some punctuation and whitespace. Now the parser can make better choices about when to accept whitespace and do a better job of enforcing dots. |
| 32 | +- We've change the internal representation of compiled JSONPath queries. We now model segments and selectors explicitly and use terminology that matches RFC 9535. |
| 33 | + |
3 | 34 | ## Version 1.3.2 |
4 | 35 |
|
5 | 36 | **Fixes** |
|
0 commit comments