package atd

  1. Overview
  2. Docs

Mapping from ATD to JSON

type json_adapter = {
  1. ocaml_adapter : string option;
    (*

    A module implementing normalize and restore.

    *)
  2. java_adapter : string option;
    (*

    tbd

    *)
}

Association between languages and json adapter for that language. The specification of each json adapter is language-specific.

val no_adapter : json_adapter
type json_float =
  1. | Float of int option
  2. | Int
type json_list =
  1. | Array
  2. | Object
type json_variant = {
  1. json_cons : string;
}
type json_field = {
  1. json_fname : string;
  2. json_unwrapped : bool;
}
type json_record = {
  1. json_keep_nulls : bool;
  2. json_record_adapter : json_adapter;
}
type json_sum = {
  1. json_sum_adapter : json_adapter;
  2. json_open_enum : bool;
  3. json_lowercase_tags : bool;
}
type json_repr =
  1. | Bool
  2. | Cell
  3. | Def
  4. | External
  5. | Field of json_field
  6. | Float of json_float
  7. | Int
  8. | List of json_list
  9. | Nullable
  10. | Option
  11. | Record of json_record
  12. | String
  13. | Sum of json_sum
  14. | Tuple
  15. | Unit
  16. | Variant of json_variant
  17. | Wrap

The different kinds of ATD nodes with their json-specific options.

val annot_schema_json : Annot.schema
val get_json_list : Annot.t -> json_list
val get_json_float : Annot.t -> json_float
val get_json_cons : string -> Annot.t -> string
val get_json_fname : string -> Annot.t -> string
val get_json_record : Annot.t -> json_record
val get_json_sum : Annot.t -> json_sum
OCaml

Innovation. Community. Security.