Version 0.9.0
Breaking Changes
CompoundJSONPath
instances are no longer updated in-place when using.union()
and.intersection()
. Instead, a newCompoundJSONPath
is returned.CompoundJSONPath.paths
is now a tuple instead of a list.
Fixes
- Fixed a bug with the parsing of JSON Pointers. When given an arbitrary string without slashes,
JSONPointer
would resolve to the document root. The empty string is the only valid pointer that should resolve to the document root. We now raise aJSONPointerError
in such cases. See #27. - Fixed handling of JSON documents containing only a top-level string.
Features
- Added a command line interface, exposing JSONPath, JSON Pointer and JSON Patch features (docs, source).
- Added
JSONPointer.parent()
, a method that returns the parent of the pointer, as a newJSONPointer
(docs). - Implemented
JSONPointer.__truediv__()
to allow creation of child pointers from an existing pointer using the slash (/
) operator (docs). - Added
JSONPointer.join()
, a method for creating child pointers. This is equivalent to using the slash (/
) operator for each argument given tojoin()
(docs). - Added
JSONPointer.exists()
, a method that returnsTrue
if a the pointer can be resolved against some data, orFalse
otherwise (docs). - Added the
RelativeJSONPointer
class for building newJSONPointer
instances from Relative JSON Pointer syntax (docs, API). - Added support for a non-standard index/property pointer using
#<property or index>
. This is to support Relative JSON Pointer's use of hash (#
) when buildingJSONPointer
instances from relative JSON Pointers. - Added the
unicode_escape
argument toJSONPathEnvironment
. WhenTrue
(the default), UTF-16 escaped sequences found in JSONPath string literals will be decoded.