package mcp-kit

  1. Overview
  2. Docs

Module Jsonschema_core.SchemaSource

JSON Schema representation.

A JSON Schema "MUST be an object or a boolean" (spec §4.3.1). Boolean schemas: true always validates, false never validates.

Sourcetype t =
  1. | Bool of bool
  2. | Obj of Yojson.Safe.t
    (*

    The raw schema object for keyword access.

    *)

A JSON Schema.

Sourceval of_json : Yojson.Safe.t -> (t, string) result

Parse a JSON value as a schema. Returns Error if the value is neither an object nor a boolean.

Sourceval keyword : string -> t -> Yojson.Safe.t option

Get a keyword value from a schema object. Returns None for boolean schemas or if the keyword is absent.

Sourceval keywords : t -> string list

Get all keyword names present in a schema object. Returns [] for boolean schemas.