Skip to content

JSONPathParser

[Source]

Parser for JSONPath expressions.

Provides two entry points: - parse() returns errors as data (consistent with JSONParser.parse()) - compile() raises on invalid input (convenience for known-valid paths)

primitive val JSONPathParser

Constructors

create

[Source]

new val create()
: JSONPathParser val^

Returns


Public Functions

parse

[Source]

Parse a JSONPath expression. Returns a compiled query on success or a structured error on failure.

fun box parse(
  path: String val)
: (JSONPath val | JSONPathParseError val)

Parameters

Returns


compile

[Source]

Parse a JSONPath expression, raising on invalid input.

Use this when the path string is known to be valid (e.g., a string literal). For user-provided paths, prefer parse() which returns errors as data.

fun box compile(
  path: String val)
: JSONPath val ?

Parameters

Returns


eq

[Source]

fun box eq(
  that: JSONPathParser val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: JSONPathParser val)
: Bool val

Parameters

Returns