Module Tomlt_bytesrw.Tagged_json

val encode : Tomlt.Toml.t -> string

encode t converts TOML value t to tagged JSON format.

The tagged JSON format wraps each value with type information:

  • Strings: {"type": "string", "value": "..."}
  • Integers: {"type": "integer", "value": "..."}
  • Floats: {"type": "float", "value": "..."}
  • Booleans: {"type": "bool", "value": "true"|"false"}
  • Datetimes: {"type": "datetime", "value": "..."}
  • Arrays: [...]
  • Tables: {...}
val decode : string -> Tomlt.Toml.t

decode s parses tagged JSON string s into a TOML value.

  • raises Failure

    if the JSON is malformed or has invalid types.

val decode_and_encode_toml : string -> (string, string) result

decode_and_encode_toml json decodes tagged JSON and encodes as TOML. Used by the toml-test encoder harness.