Jsont_typegistDerive JSON types from OCaml type gists.
The to_jsont function derives a Jsont.t value from a Typegist.Type.Gist.t value.
A few metadata keys in Meta keys can be used to customize the computed JSON type or selectively override the deriving function with a manually provided Jsont.t value.
See an example.
val to_jsont : 'a Typegist.Type.Gist.t -> 'a Jsont.tto_jsont g is a JSON type derived fom g.
In general:
Typegist.Type.Gist.type_name is used for Jsont.kind.Typegist.Type.Gist.Meta.Doc (if any) is used for Jsont.doc.Note the following:
Typegist.Type.Gist.Float uses Jsont.number by default.Typegist.Type.Gist.Int64 uses Jsont.int64 by default.Typegist.Type.Gist.String uses Jsont.string by default.Typegist.Type.Gist.String uses a transformed Jsont.binary_string by default.Raises Invalid_argument in the following cases:
Typegist.Type.Gist.Ignore is specified on a field but the field has no Typegist.Type.Gist.Field.default value.val gist : 'a Typegist.Type.Gist.t -> 'a Jsont.t Typegist.Type.Gist.tgist g is a gist for JSON type values. This is not really usable in general but can be useful to inspect Jsont.t values with Typegist.Fun.Generic.pp.
This example overrides the string key.