Version 0.9.0
Breaking Changes
CompoundJSONPathinstances are no longer updated in-place when using.union()and.intersection(). Instead, a newCompoundJSONPathis returned.CompoundJSONPath.pathsis now a tuple instead of a list.
Fixes
- Fixed a bug with the parsing of JSON Pointers. When given an arbitrary string without slashes,
JSONPointerwould resolve to the document root. The empty string is the only valid pointer that should resolve to the document root. We now raise aJSONPointerErrorin 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 returnsTrueif a the pointer can be resolved against some data, orFalseotherwise (docs). - Added the
RelativeJSONPointerclass for building newJSONPointerinstances 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 buildingJSONPointerinstances from relative JSON Pointers. - Added the
unicode_escapeargument toJSONPathEnvironment. WhenTrue(the default), UTF-16 escaped sequences found in JSONPath string literals will be decoded.