Mavryk_openapi.JsonHelpers to read JSON values.
Contains functions to parse JSON values, show them for debugging, and extract information from them.
Functions which extract information are rather strict: they don't try to be smart and automatically convert. For instance, as_record makes sure that all fields are taken into account. This is suited to write a tool that must be updated when the format of JSON values being manipulated changes. In our case, if the JSON schemas we read start to get more fields, we want to know; otherwise the resulting OpenAPI specification could be inaccurate.
include module type of struct include JSON endval show_error : error -> stringexception Error of errorval error : t -> ('a, unit, string, 'b) Stdlib.format4 -> 'aval encode : t -> stringval encode_u : u -> stringval encode_to_file : string -> t -> unitval encode_to_file_u : string -> u -> unitval parse_file : string -> tval parse : origin:string -> string -> tval parse_opt : origin:string -> string -> t optionval is_null : t -> boolval as_bool : t -> boolval as_bool_opt : t -> bool optionval is_bool : t -> boolval as_int : t -> intval as_int_opt : t -> int optionval is_int : t -> boolval as_int64 : t -> int64val as_int64_opt : t -> int64 optionval is_int64 : t -> boolval as_int32 : t -> int32val as_int32_opt : t -> int32 optionval is_int32 : t -> boolval as_float : t -> floatval as_float_opt : t -> float optionval is_float : t -> boolval as_string : t -> stringval as_string_opt : t -> string optionval is_string : t -> boolval is_list : t -> boolval is_object : t -> bool