package mcp-kit
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.
Source
type annotation = {keyword : string;value : Yojson.Safe.t;instance_location : Jsonschema_core.Json_pointer.t;schema_location : Jsonschema_core.Json_pointer.t;keyword_location : Jsonschema_core.Json_pointer.t;absolute_keyword_location : Uri.t option;
}Source
type output_unit = {valid : bool;keyword_location : Jsonschema_core.Json_pointer.t;absolute_keyword_location : Uri.t option;instance_location : Jsonschema_core.Json_pointer.t;error : string option;annotation : Yojson.Safe.t option;errors : output_unit list;annotations : output_unit list;
}Source
type result = {valid : bool;errors : error list;annotations : annotation list;output : output_format -> Yojson.Safe.t;
}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.
Source
val metaschema_retriever :
?retriever:(Uri.t -> Yojson.Safe.t option) ->
Uri.t ->
Yojson.Safe.t optionResolve 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.