Version 1.2.0
Fixes
- Fixed handling of JSONPath literals in filter expressions. We now raise a
JSONPathSyntaxError
if a filter expression literal is not part of a comparison, membership or function expression. See jsonpath-compliance-test-suite#81. - Fixed parsing of number literals including an exponent. Upper case 'e's are now allowed.
- Fixed handling of trailing commas in bracketed selection lists. We now raise a
JSONPathSyntaxError
in such cases.
Compliance
- Skipped tests for invalid escape sequences. The JSONPath spec is more strict than Python's JSON decoder when it comes to parsing
\u
escape sequences in string literals. We are adopting a policy of least surprise. The assertion is that most people will expect the JSONPath parser to behave the same as Python's JSON parser. See jsonpath-compliance-test-suite #87. - Skipped tests for invalid integer and float literals. Same as above. We are deliberately choosing to match Python's int and float parsing behavior. See jsonpath-compliance-test-suite #89.
- Skipped tests for incorrect casing
true
,false
andnull
literals.
Features
- Allow JSONPath filter expression membership operators (
contains
andin
) to operate on object/mapping data as well as arrays/sequences. See #55. - Added a
select()
method to the JSONPath query iterator interface, generating a projection of each JSONPath match by selecting a subset of its values. - Added the
query()
method to theJSONPath
class. Get a query iterator from an already compiled path. - Added the
addne
andaddap
operations to JSONPatch.addne
(add if not exists) is like the standardadd
operation, but only adds object keys/values if the key does not exist.addap
(add or append) is like the standardadd
operation, but assumes an index of-
if the target index can not be resolved.