JsonschemaSourceJSON Schema validator supporting drafts 4, 6, 7, 2019-09, and 2020-12
Supported draft versions
A compiled JSON schema
Instance location token
Instance location in the validated document
Set of JSON types
type error_kind = | Group| Schema of {}| Content_schema| Property_name of {}| Reference of {}| Ref_cycle of {}| False_schema| Type of {got : Yojson.Basic.t;want : type_set;}| Enum of {want : Yojson.Basic.t list;}| Const of {want : Yojson.Basic.t;}| Format of {got : Yojson.Basic.t;want : string;err : exn;}| Min_properties of {}| Max_properties of {}| Additional_properties of {}| Unevaluated_properties of {}| Unevaluated_items of {}| Required of {}| Dependency of {}| Dependent_required of {}| Min_items of {}| Max_items of {}| Contains| Min_contains of {}| Max_contains of {}| Unique_items of {}| Additional_items of {}| Min_length of {}| Max_length of {}| Pattern of {}| Content_encoding of {}| Content_media_type of {}| Minimum of {}| Maximum of {}| Exclusive_minimum of {}| Exclusive_maximum of {}| Multiple_of of {}| Not| All_of| Any_of| One_of of (int * int) optionValidation error kinds
type validation_error = {schema_url : string;instance_location : instance_location;kind : error_kind;causes : validation_error list;}Validation error
type compile_error = | Parse_url_error of {}| Load_url_error of {}| Unsupported_url_scheme of {}| Invalid_meta_schema_url of {}| Unsupported_draft of {}| MetaSchema_cycle of {}| Validation_error of {url : string;src : validation_error;}| Parse_id_error of {}| Parse_anchor_error of {}| Duplicate_id of {}| Duplicate_anchor of {}| Invalid_json_pointer of string| Json_pointer_not_found of string| Anchor_not_found of {}| Unsupported_vocabulary of {}| Invalid_regex of {}| Bug of exnCompilation errors
JSON pointer for navigating JSON documents
A reusable validator
val validate_file :
?draft:draft ->
schema:string ->
Yojson.Basic.t ->
(unit, validation_error) resultValidate JSON against a schema from a file/URL
val validate_strings :
?draft:draft ->
schema:string ->
json:string ->
unit ->
(unit, validation_error) resultValidate JSON string against schema string
val create_validator :
?draft:draft ->
?enable_format_assertions:bool ->
?enable_content_assertions:bool ->
string ->
(validator, compile_error) resultCreate a reusable validator for efficiency
Validate using a pre-compiled validator
val create_validator_with_loader :
?draft:draft ->
?enable_format_assertions:bool ->
?enable_content_assertions:bool ->
url_loader:Loader.url_loader ->
schema:Yojson.Basic.t ->
unit ->
(validator, compile_error) resultCreate a validator with a custom URL loader for remote refs
val create_validator_from_json :
?draft:draft ->
?enable_format_assertions:bool ->
?enable_content_assertions:bool ->
schema:Yojson.Basic.t ->
unit ->
(validator, compile_error) resultCreate a validator from JSON schema (for testing)