Releases: jg-rp/python-jsonpath
Releases · jg-rp/python-jsonpath
Version 0.6.0
Breaking changes
- The "extra filter context" identifier now defaults to
_. Previously it defaulted to#, but it has been decided that#is better suited as a current key/property or index identifier.
Features
- Added a non-standard keys/properties selector (docs, source).
- Added a non-standard
typeof()filter function.type()is an alias fortypeof()(docs, source). - Added a non-standard
isinstance()filter function.is()is an alias forisinstance()(docs, source). - Added a current key/property or index identifier. When filtering a mapping,
#will hold key associated with the current node (@). When filtering a sequence,#will hold the current index. See docs.
IETF JSONPath Draft compliance
- Don't allow leading zeros in index selectors. We now raise a
JSONPathSyntaxError. - Validate the built-in
count()function's argument is array-like.
Version 0.5.0
Features
- Added the built-in
matchfilter function. - Added the built-in
searchfilter function. - Added the built-in
valuefilter function. - We now pass the current environment to filter function validation.
- Added support for the wildcard selector in selector segment lists.
- We now allow nested filters.
Fixes
- Fixed a bug where the current object selector (
@) would evaluate toundefinedwhen a filter is applied to an array of strings. - Compound paths that have a trailing
|or&now raise aJSONPathSyntaxError.
IETF JSONPath Draft compliance
- Removed support for dotted index selectors.
- Raise a
JSONPathSyntaxErrorfor unescaped whitespace and control characters. - Raise a
JSONPathSyntaxErrorfor empty selector segments. - Raise a
JSONPathIndexErrorif an index selector is out of range. - Raise a
JSONPathSyntaxErrorfor too many colons in a slice selector. - Raise a
JSONPathIndexErrorif a slice selector argument is out of range.
Version 0.4.0
IETF JSONPath Draft compliance
- Behavioral change. When applied to a JSON object, filters now have an implicit preceding wildcard selector and the "current" (
@) object is set to each of the object's values. This is now consistent with applying filters to arrays and adheres to the IETF JSONPath Internet Draft.
Version 0.3.0
IETF JSONPath Draft compliance
- Added support for function extensions.
- Added the built-in
length()function. - Added the built-in
count()function.count()is an alias forlength(). - Support filters without parentheses.
- Adhere to IETF JSONPath draft escaping in quoted property selectors.
- Handle UTF-16 surrogate pairs in quoted property selectors.
Features
- Added the built-in
keys()function. - Added
parentandchildrenproperties toJSONPathMatch. Now we can traverse the "document tree" after finding matches. - Added a
partsproperty toJSONPathMatch.partsis a tuple ofints,slices andstrs that can be used withJSONPathEnvironment.getitem()to get the matched object from the original data structure, or equivalent data structures. It is the keys, indices and slices that make up a concrete path.