Version 1.2.0
Fixes
- Fixed handling of JSONPath literals in filter expressions. We now raise a
JSONPathSyntaxErrorif 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
JSONPathSyntaxErrorin 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
\uescape 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,falseandnullliterals.
Features
- Allow JSONPath filter expression membership operators (
containsandin) 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 theJSONPathclass. Get a query iterator from an already compiled path. - Added the
addneandaddapoperations to JSONPatch.addne(add if not exists) is like the standardaddoperation, but only adds object keys/values if the key does not exist.addap(add or append) is like the standardaddoperation, but assumes an index of-if the target index can not be resolved.