From 2ec6cb981f7a987fe6cf9dfeadd8960b3a8a6b7f Mon Sep 17 00:00:00 2001 From: Lucas Franceschino Date: Mon, 3 Jun 2024 11:33:32 +0200 Subject: [PATCH] fix(ci): only one deriving clause is necessary --- .../utils/ocaml_of_json_schema/ocaml_of_json_schema.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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}) =>