package hl_yaml

  1. Overview
  2. Docs
module OneOrList : sig ... end
module OneOrArray : sig ... end
type object_entry = {
  1. key : string;
  2. required : bool;
  3. spec : t;
}
and schema_keys
and enum
and t =
  1. | JAny
  2. | JAtom
    (*

    Atoms are supposed to be strings, but other simple values are okay (int, float, bool)

    *)
  3. | JNull
  4. | JBool
  5. | JInt
  6. | JFloat
  7. | JNumeric
  8. | JString
  9. | JEnum of enum
  10. | JArray of t
  11. | JOneOrArray of t
  12. | JObject of t
  13. | JSchema of {
    1. name : string;
    2. reject_extras : bool;
    3. keys : schema_keys;
    }
val object_entry_to_yojson : object_entry -> Yojson.Safe.t
val schema_keys_to_yojson : schema_keys -> Yojson.Safe.t
val enum_to_yojson : enum -> Yojson.Safe.t
val to_yojson : t -> Yojson.Safe.t
val make_enum : Yojson.Basic.t list -> t
val make_schema : name:string -> reject_extras:bool -> object_entry list -> t
val to_string : t -> string
type step =
  1. | Dot of string
  2. | Index of int
val step_to_yojson : step -> Yojson.Safe.t
type path = step list
val path_to_yojson : path -> Yojson.Safe.t
type error =
  1. | Extraneous of {
    1. path : path;
    2. name : string option;
    3. extra : Yojson.Safe.t;
    }
  2. | Missing of {
    1. path : path;
    2. name : string option;
    3. missing : t;
    }
  3. | Type of {
    1. path : path;
    2. name : string option;
    3. expected : t;
    4. found : Yojson.Safe.t;
    }
  4. | Incorrect_value of {
    1. path : path;
    2. name : string option;
    3. expected : Yojson.Basic.t list;
    4. found : Yojson.Safe.t;
    }
  5. | Deserialization of {
    1. message : string;
    2. attempted : [ `JSON of Yojson.Safe.t | `String of string ];
    }
  6. | Processing of {
    1. message : string;
    }
val error_to_yojson : error -> Yojson.Safe.t
val validate : ?path:path -> ?nullable:bool -> t -> Yojson.Safe.t -> error list
val error_to_string : ?emphasis:(string -> string) -> error -> string
OCaml

Innovation. Community. Security.