All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ocaml.enums.mustache Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
{{>partial_header}}
{{#description}}
 * Schema {{{classname}}} : {{{description}}}
{{/description}}
 *)
{{#models}}
{{#model}}
{{#isEnum}}

type {{name}} = [
{{#allowableValues}}
{{#values}}
| {{{camlEnumValueName}}} [@printer fun fmt _ -> Format.pp_print_string fmt "{{{name}}}"] [@name "{{{name}}}"]
{{/values}}
{{/allowableValues}}
] [@@deriving yojson, show { with_path = false }];;

let {{name}}_of_yojson json = {{name}}_of_yojson (`List [json])
let {{name}}_to_yojson e =
    match {{name}}_to_yojson e with
    | `List [json] -> json
    | json -> json
{{/isEnum}}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy