package jsonxt
Module Jsonxt.JsonSource
Json types for the various compliance levels
Source
type json = [ | `Null| `Bool of bool| `Int of int| `Intlit of string| `Float of float| `Floatlit of string| `String of string| `Stringlit of string| `Assoc of (string * json) list| `List of json list| `Tuple of json list| `Variant of string * json option
]The following is a complete list of the polymorphic variants supported by Jsonxt
- `Null: JSON null
- `Bool of bool: JSON boolean
- `Int of int: JSON number without decimal point or exponent.
- `Intlit of string: JSON number without decimal point or exponent, preserved as a string.
- `Float of float: JSON number, inf, -inf, Infinity, -Infinity, nan, -nan, NaN or -NaN
- `Floatlit of string: JSON number, inf, -inf, Infinity, -Infinity, nan, -nan, NaN or -NaN, preserved as a string.
- `String of string: JSON string. Bytes in the range 128-255 are preserved when reading and writing.
- `Stringlit of string: JSON string literal including the double quotes.
- `Assoc of (string * json) list: JSON object.
- `List of json list: JSON array.
- `Tuple of json list: Tuple (non-standard extension of JSON). Syntax: ("abc", 123).
- `Variant of (string * json option): Variant (non-standard extension of JSON). Syntax: <"Foo"> or <"Bar":123>.
Extended supports all Json types including the non-standard tuple and variant introduced by Yojson
Basic supports standard Json types that are supported by the JSON standard but also supports integers rather than just floats