Module Jsont.Path

JSON paths.

Paths are used for keeping track of encoding and decoding contexts and for specifying queries.


type index =
  1. | Mem of string node

    Indexes the value of the member n of an object.

  2. | Nth of int node

    Indexes the value of the nth element of an array. If negative counts the number of elements from the end: -1 is that last element.


The type for indexing operations on JSON values.

val pp_index : index fmt

pp_index formats indexes.

val pp_index_trace : index fmt

pp_index formats indexes and their location.


type t = index list

The type for paths, a sequence of indexing operations in reverse order.

val of_string : string -> (t, string) Stdlib.result

of_string s parses a path according to the path syntax.

val pp : t fmt

pp formats paths.

val pp_trace : t fmt

pp_path_trace formats paths as a stack trace.