Module Sch

module Json_schema : sig ... end
module Constraint = Json_schema.Constraint
module Free : sig ... end
module Sig : sig ... end
module File : sig ... end
type unknown_handling =
  1. | Skip
  2. | Error_on_unknown
type 'o fieldk
type ('o, 'a) field = {
  1. name : string;
  2. doc : string;
  3. codec : 'a t;
  4. default : 'a option;
  5. get : 'o -> 'a;
  6. omit : 'a -> bool;
}
and 'a base_map = {
  1. doc : string;
  2. constraint_ : 'a Constraint.t option;
}
and 'a union_case =
  1. | Case : {
    1. tag : string;
    2. doc : string;
    3. codec : 'b t;
    4. inject : 'b -> 'a;
    5. project : 'a -> 'b option;
    } -> 'a union_case
    (*

    a prism like structure for union cases, the inject and project functions are used to convert between the case payload and the union type

    *)
and _ t =
  1. | Str : string base_map -> string t
  2. | Password : string base_map -> string t
  3. | Int : int base_map -> int t
  4. | Int32 : int32 base_map -> int32 t
  5. | Int64 : int64 base_map -> int64 t
  6. | Bool : {
    1. doc : string;
    } -> bool t
  7. | Float : float base_map -> float t
  8. | Double : float base_map -> float t
  9. | File : File.t t
  10. | Option : 'a t -> 'a option t
  11. | List : {
    1. doc : string;
    2. item : 'a t;
    3. constraint_ : 'a list Constraint.t option;
    } -> 'a list t
  12. | Object : {
    1. kind : string;
    2. doc : string;
    3. unknown : unknown_handling;
    4. members : ('o fieldk, 'o) Free.t;
    } -> 'o t
  13. | Union : {
    1. doc : string;
    2. discriminator : string;
    3. cases : 'a union_case list;
    } -> 'a t
  14. | Rec : 'a t Stdlib.Lazy.t -> 'a t
  15. | Iso : {
    1. fwd : 'b -> ('a, string list) Stdlib.result;
    2. bwd : 'a -> 'b;
    3. repr : 'b t;
    } -> 'a t
type decode_error = {
  1. path : string list;
  2. message : string;
}
val error : string -> decode_error
val errors : string list -> decode_error list
val in_field : string -> decode_error list -> decode_error list
val error_to_pair : decode_error -> string * string
val type_name : 'a t -> string
val format_name : 'a t -> string option
val doc : 'a t -> string
val with_ : ?constraint_:'a Constraint.t -> ?doc:string -> ?discriminator:string -> 'a t -> 'a t
val is_object_codec : 'a t -> bool
val string : string t
val password : string t
val bool : bool t
val int : int t
val int32 : int32 t
val int64 : int64 t
val float : float t
val double : float t
val file : File.t t
val option : 'a t -> 'a option t
val rec' : 'a t Stdlib.Lazy.t -> 'a t
val custom : enc:('a -> 'b) -> dec:('b -> ('a, string list) Stdlib.result) -> 'b t -> 'a t
val list : ?doc:string -> ?constraint_:'a list Constraint.t -> 'a t -> 'a list t
module Object : sig ... end
module Union : sig ... end
module Validation : sig ... end
type mem_lookup = string -> Jsont.object' -> Jsont.json option
val mem_exact : mem_lookup
val mem_ci : mem_lookup
val mem_is_known_exact : (string, 'a) Stdlib.Hashtbl.t -> Jsont.name -> bool
val mem_is_known_ci : (string, 'a) Stdlib.Hashtbl.t -> Jsont.name -> bool
module Json : sig ... end
val to_json_schema : ?draft:Json_schema.Draft.t -> 'a t -> Json_schema.t