package jsonxt

  1. Overview
  2. Docs

Json stream types for the various compliance levels

type json = [
  1. | `Null
  2. | `Bool of bool
  3. | `Int of int
  4. | `Intlit of string
  5. | `Float of float
  6. | `Floatlit of string
  7. | `String of string
  8. | `Stringlit of string
  9. | `As
  10. | `Ae
  11. | `Os
  12. | `Oe
  13. | `Ts
  14. | `Te
  15. | `Vs
  16. | `Ve
  17. | `Name of string
  18. | `Infinity
  19. | `Neg_infinity
  20. | `Nan
]

The following polymorphic variants are 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 preserved as a string
  • `String of string: JSON string with characters in the range 128-255 preserved
  • `Stringlit of string: JSON string including the double quotes
  • `As - Array start marker
  • `Ae - Array end marker
  • `Os - Object start marker
  • `Oe - Object end marker
  • `Ts - Tuple start marker
  • `Te - Tuple end marger
  • `Vs - Variant start marger
  • `Ve - Variant end marger
  • `Name of string - JSON object key as a JSON string
  • `Infinity - Infinity
  • `Neg_infinity - -Infinity
  • `Nan - NaN
type t = json
module Extended : sig ... end

Extended supports all Json types including the non-standard tuple and variant introduced by Yojson

module Basic : sig ... end

Basic supports standard Json types that are supported by the JSON standard but also supports integers rather than just floats

module Strict : sig ... end

Strict supports only types that are supported by the JSON standard. Integers are not supported

OCaml

Innovation. Community. Security.