Module djson.jsonpath

JSONPath (RFC 9535) support: expression compiler and queries over a JValue tree.

The same compiler is used by JValue.select and by walkJSON; get, set and the other path-based methods keep using JSON Pointers. It also accepts JSON Pointers (expressions starting with /), with the same rules as JValue.get.

Supported syntax: $, .name, ['name'], [n] (negative counts from the end), [*], .*, descendants (..name, ..*, ..[n]), unions (['a','b'], [0,2]) and slices ([1:5], [::-1]). Filter expressions ([?...]) are not supported.

Functions

NameDescription
pathToString(path) Formats a node path as a normalized JSONPath (RFC 9535), e.g. $['coordinates'][3]['x'].

Structs

NameDescription
JSONPathResult Nodes selected by JValue.select, in JSONPath result order.
PathItem One step of the path from the root to a node.