Chatoyant_schema.CodecSourceTyped JSON codecs that carry JSON Schema.
A codec is the small bridge Chatoyant needs for ergonomic tool definitions: one value knows how to describe JSON with schema, decode incoming JSON into an OCaml value, and encode an OCaml value back to JSON.
val custom :
schema:Schema.field ->
encode:('a -> Chatoyant_runtime.Json.t) ->
decode:(Chatoyant_runtime.Json.t -> ('a, string) result) ->
'a tBuild a codec from explicit schema/encoder/decoder pieces.
This is primarily the low-level hook used by generated code and custom integrations. Prefer the typed builders or chatoyant.ppx in application code.
Return an equivalent codec with its schema transformed.
Decode a field from a JSON object, respecting optional codecs.