Wiretype.ShapeWhat a description is: the representation Wiretype's combinators make, and everything that reads a description walks -- the decoder, the encoder, the schema printers, and anybody with a use of their own.
It is the library's API and its promise: a constructor added is a new version, so a walk that matches every case is told by the compiler. A description is built with the combinators in Wiretype; one built here directly is as good to read, since everything that reads one checks what it reads, and is trusted to be written as Wiretype.Object.finish would let it be: no member named twice in an object.
What a description is called -- a component's name, where it is an object -- and what it is, for whoever documents it. Empty when it has neither. Each object Wiretype.Object.finish makes has a record of its own, and the schema and the writer tell objects apart by it; an object built here directly gets one of its own too.
In code points, as JSON Schema counts a string's length.
type format = | Date_timeRFC 3339 date-time
| DateRFC 3339 full-date
| DurationISO 8601, with no years or months
*)| Uuid of uuid_version optionRFC 9562, of one version where it names one
*)| Base64RFC 4648 §4
*)| Base64urlRFC 4648 §5
*)| UriRFC 3986
*)| Ipv4| Ipv6What a string is written in, where a schema has a word for it.
Which of a request and an answer a member is in, as OpenAPI's readOnly and writeOnly say.
type 'a t = | Null : 'a -> 'a tJSON null, read as the value
| Bool : bool t| Int : int_bounds -> int t| Int64 : int64_bounds -> int64 t| Number : number_bounds -> float t| String : length -> string t| Enum : about * 'a enum -> 'a t| List : 'a elements -> 'a list t| Tuple : ('a, 'a) items -> 'a ta JSON array of exactly its items, each of its own description
*)| Dict : ('k, 'v) dict -> ('k * 'v) list ta JSON object read as a map: its members, in the document's order
*)| Nullable : 'a t -> 'a option tthe description, or null
| Object : about * 'o obj -> 'o t| Any : about * 'a any -> 'a t| Map : about * ('a, 'b) map -> 'b t| Value : Value.t tany JSON
*)| Rec : 'a t Stdlib.Lazy.t -> 'a ta description of itself
*)What a tuple is made of, in order: a function, and each item it is applied to, as an object is its members.
An object: the function that builds its value, applied to its members.
and ('o, 'f) fields = | Build : 'f -> ('o, 'f) fields| Unread : ('o, 'f) fieldsan object that is written and never read: an answer to somebody else's server
*)| Mem : ('o, 'a -> 'f) fields * ('o, 'a) mem -> ('o, 'f) fields| Cases : ('o, 'c -> 'f) fields * ('o, 'c) cases -> ('o, 'f) fieldsthe members that depend on one member's value: a union by its tag
*)What an object is made of, in the order it was declared: a function, and each member it is applied to.
and ('o, 'a) mem = {name : string;field : string option;the OCaml field it is in, where a printer of OCaml should name it so
*)doc : string;shape : 'a t;absent : 'a option;what it reads as when left out; required if none
*)omit : ('a -> bool) option;whether a value is written by leaving it out
*)get : ('o -> 'a) option;the member of a value; none reads only
*)opt : bool;access : access;deprecated : bool;examples : 'a list;}and ('o, 'c) cases = | Tagged : {name : string;the tag's member
*)doc : string;shape : 'tag t;absent : 'tag option;the tag a value with none is read as
*)omit : ('tag -> bool) option;enc : ('o -> 'c) option;enc_case : 'c -> ('c, 'tag) case_value;cases : ('c, 'tag) case list;} -> ('o, 'c) casesand 'a any = {null : 'a t option;bool : 'a t option;number : 'a t option;string : 'a t option;array : 'a t option;object_ : 'a t option;pick : ('a -> 'a t) option;the description a value is written by
*)}A value that is one of several JSON sorts, a description per sort.
and ('a, 'b) map = {format : format option;inner : 'a t;parse : ('a -> ('b, string) Stdlib.result) option;Error is a sentence for a person: what is wrong with the value
print : ('b -> ('a, string) Stdlib.result) option;}A description of another type, over inner: a kind -- an instant, an id -- or a plain change of type. A direction left out is one it is never used in.