package mcp-kit

  1. Overview
  2. Docs

Module Jsonschema_core.Json_pointerSource

JSON Pointer (RFC 6901).

A JSON Pointer is a string syntax for identifying a specific value within a JSON document. Example: /foo/bar/0 points to the first element of the array at key "bar" inside object "foo".

Sourcetype t = string list

A parsed JSON Pointer as a list of unescaped reference tokens. The empty list represents the root pointer "".

Sourceval of_string : string -> (t, string) result

Parse a JSON Pointer string into reference tokens. Returns Error for strings that don't start with / (except empty string). Unescapes ~1 to / and ~0 to ~.

Sourceval to_string : t -> string

Serialize a JSON Pointer to its string representation. Escapes ~ to ~0 and / to ~1.

Sourceval resolve : t -> Yojson.Safe.t -> Yojson.Safe.t option

Resolve a JSON Pointer against a JSON value. Returns the sub-value at the given path, or None if the path does not exist in the document.

Sourceval append : t -> string -> t

Append a single reference token to a pointer.

Sourceval empty : t

The empty (root) pointer.