diff --git a/engine/utils/ocaml_of_json_schema/ocaml_of_json_schema.js b/engine/utils/ocaml_of_json_schema/ocaml_of_json_schema.js index 04cb7f644..13e3b94c9 100644 --- a/engine/utils/ocaml_of_json_schema/ocaml_of_json_schema.js +++ b/engine/utils/ocaml_of_json_schema/ocaml_of_json_schema.js @@ -532,8 +532,14 @@ end open ParseError `; - impl += ('type ' + items.map(({name, type}) => - `${name} = ${type}\n${derive_items.length ? `[@@deriving ${derive_items.join(', ')}]` : ''}`).join('\nand ') + let derive_clause = derive_items.length ? `[@@deriving ${derive_items.join(', ')}]` : ''; + + impl += ( + 'type ' + + items.map(({name, type}) => + `${name} = ${type}\n` + ).join('\nand ') + + derive_clause ); impl += (''); impl += ('let rec ' + items.map(({name, type, parse}) =>