Module Avro_compiler_lib.Schema

module J = Yojson.Safe
type atomic_type =
| Null
| Bool
| Int32
| Int64
| Float32
| Float64
| Bytes
| String
type top_type =
| Atomic of atomic_type
| Named of string
| Array of top_type
| Str_map of top_type
| Union of top_type list
| Fixed of {
name : string;
namespace : string option;
doc : string option;
size : int;
}
| Enum of {
name : string;
namespace : string option;
symbols : string list;
doc : string option;
aliases : string list option;
}
| Record of {
name : string;
namespace : string option;
fields : record_field list;
doc : string option;
aliases : string list option;
}
and record_field = {
name : string;
doc : string option;
ty : top_type;
}
type t = top_type

A toplevel schema.

val json_of_atomic : atomic_type -> J.t
val to_json : t -> J.t
val json_of_field : record_field -> J.t
val of_json : J.t -> (t, string) Stdlib.result
val pp : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val parse_string : string -> (t, string) Stdlib.result
val parse_file : string -> (t, string) Stdlib.result