package goblint
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=999272bfbd3b9b96fcd58987b237ac6e9fa6d92ef935cc89f1ea2b4205185141
sha512=f3bf6ab71cf8c258d3290da4bf9f6fe42d7c671822e0efeb0fc50afdff078ab15e352237e5c1db31c5aa3a9d430691268ed2e5e00da10f2615835f672f91683d
doc/goblint.lib/JsonSchema/index.html
Module JsonSchema
A simpler schema than http://json-schema.org
and jschema = {
sid : string option;
(*identificator
*)sdescr : string option;
(*description
*)stype : jtype option;
(*a type with possibly extra information
*)sdefault : Yojson.Safe.t option;
(*the default value
*)mutable saddenum : jschema list;
(*additional schemata that were loaded separately
*)
}
a schema for a jvalue
extra schema information for an array jvalue
and jobj = {
sprops : (string * jschema) list;
(*properties
*)spatternprops : (string * jschema) list;
(*regular expression properties
*)sadditionalprops : bool;
(*are all properties acounted in the schema
*)srequired : string list;
(*list of required properties
*)
}
extra schema information for an object jvalue
An exception that indicates that some jschema
is was invalid.
An exception that indicates that some jvalue
was not valid according to some jschema
.
val collectIds : jschema -> string list
Collect all ids from the jschema
.
val validate : jschema -> Yojson.Safe.t -> unit
Call to validate s v
validates the jvalue
v
in the jschema
s
. Invalidness is communicated using the exception JsonMalformed
.
val fromJson : Yojson.Safe.t -> jschema
Convert a jvalue
to a jschema
if possible. Raise JsonSchemaMalformed
otherwise.