module Kojson:sig
..end
typejson =
[ `Assoc of (string * json) list
| `Bool of bool
| `Float of float
| `Int of int
| `List of json list
| `Null
| `String of string ]
Yojson.Basic.json
.typepath =
[ `Index of int | `Label of string ] list
val string_of_path : path -> string
typeexpectation =
[ `either of (path * expectation) list
| `expecting_label of string
| `expecting_type of string
| `expecting_value of json
| `expecting_values of json list
| `not_expecting_labels of string list ]
exception Mismatch of path * expectation
val string_of_mismatch : path * expectation -> string
val default_warn : (path -> string -> unit) Pervasives.ref
Kojson.jin_of_json
.
The following types form the domain of patterns, which can be built up
from the definitions in Kojson_pattern
.
typejin =
Kojson_private.jin
jin ->
'a
which throws Kojson.Mismatch
if it does not match its argument.val jin_of_json : ?warn:(path -> string -> unit) ->
?path:path -> json -> jin
warn
: A callback to record warnings about unused labels. The
default is Kojson.default_warn
.path
: The root path of JSON tree, if not []
.val jin_path : jin -> path
typejain =
Kojson_private.jain
jain -> 'a
which throws Kojson.Mismatch
if it does not
match its argument.val jain_path : jain -> path