A JSONPath is a query consisting of a root identifier followed by a series of segments (with optional blank space between). Each segment takes the result of the previous root identifier (or segment) and provides input to the next segment, in the form of a nodelist. A valid query is executed against a value and produces a node list.

Static methods

staticquery(path:String, value:JSONData):Array<JSONData>

Performs the provided JSONPath query on the query argument, and provides the query result as a list of JSON values that were located.

Parameters:

path
value

Returns:

A list of JSON data values.

@:value({ allowNewPaths : false })staticqueryPaths(path:String, value:JSONData, allowNewPaths:Bool = false):Array<String>

Performs the provided JSONPath query on the query argument, and provides the query result as a list of normalized paths into the query argument.

Parameters:

path

The JSONPath query to perform

value

The value to query

allowNewPaths

Whether to create new paths for non-filter selectors For example, $.a.b will return $['a']['b'] even if a or b do not exist.

Returns:

A list of JSON normalized paths.

staticsplitNormalizedPath(path:String):PathParts

Split a normalized path $['a']['b']['c'][1] into ['a', 'b', 'c', '1']

Returns:

An array of path parts, either string identifiers or integer array indices