package mcp-kit

  1. Overview
  2. Docs

Module Jsonschema_validationSource

JSON Schema validation and result output.

Compiles JSON Schema documents into validators and validates JSON instances against them through explicit draft-specific modules. Result APIs expose structured errors, annotations, and output JSON projections.

Re-export core types.

Sourcetype output_format =
  1. | Flag
  2. | Basic
  3. | Detailed
  4. | Verbose
Sourcetype annotation = {
  1. keyword : string;
  2. value : Yojson.Safe.t;
  3. instance_location : Jsonschema_core.Json_pointer.t;
  4. schema_location : Jsonschema_core.Json_pointer.t;
  5. keyword_location : Jsonschema_core.Json_pointer.t;
  6. absolute_keyword_location : Uri.t option;
}
Sourcetype output_unit = {
  1. valid : bool;
  2. keyword_location : Jsonschema_core.Json_pointer.t;
  3. absolute_keyword_location : Uri.t option;
  4. instance_location : Jsonschema_core.Json_pointer.t;
  5. error : string option;
  6. annotation : Yojson.Safe.t option;
  7. errors : output_unit list;
  8. annotations : output_unit list;
}
Sourcetype result = {
  1. valid : bool;
  2. errors : error list;
  3. annotations : annotation list;
  4. output : output_format -> Yojson.Safe.t;
}
Sourcetype evaluator

Retriever boundary: retrievers return already parsed JSON resources. The validation API does not receive transport metadata such as HTTP Content-Type, so media-type policy for remotely fetched resources is the caller/retriever responsibility.

Sourceval metaschema_retriever : ?retriever:(Uri.t -> Yojson.Safe.t option) -> Uri.t -> Yojson.Safe.t option

Resolve bundled official JSON Schema metaschemas before falling back to an optional caller retriever. This covers the public draft metaschema URIs and the 2019-09/2020-12 vocabulary metaschema resources bundled with the library.

Sourcemodule type LAYER = sig ... end

Explicit JSON Schema draft layers.