Skip to content

Version 0.9.0

Compare
Choose a tag to compare
@jg-rp jg-rp released this 22 Jul 12:42
· 113 commits to main since this release

Breaking Changes

  • CompoundJSONPath instances are no longer updated in-place when using .union() and .intersection(). Instead, a new CompoundJSONPath 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 a JSONPointerError 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 new JSONPointer (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 to join() (docs).
  • Added JSONPointer.exists(), a method that returns True if a the pointer can be resolved against some data, or False otherwise (docs).
  • Added the RelativeJSONPointer class for building new JSONPointer 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 building JSONPointer instances from relative JSON Pointers.
  • Added the unicode_escape argument to JSONPathEnvironment. When True (the default), UTF-16 escaped sequences found in JSONPath string literals will be decoded.