diff --git a/modules/openapi-generator/src/main/resources/ocaml/enums.mustache b/modules/openapi-generator/src/main/resources/ocaml/enums.mustache index a9aed87db27..e291bc4f32d 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/enums.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/enums.mustache @@ -13,7 +13,7 @@ type {{name}} = [ | {{{camlEnumValueName}}} [@printer fun fmt _ -> Format.pp_print_string fmt "{{{name}}}"] [@name "{{{name}}}"] {{/values}} {{/allowableValues}} -] [@@deriving yojson, show { with_path = false }];; +] [@@deriving yojson, show { with_path = false }, eq];; let {{name}}_of_yojson json = {{name}}_of_yojson (`List [json]) let {{name}}_to_yojson e = diff --git a/modules/openapi-generator/src/main/resources/ocaml/model.mustache b/modules/openapi-generator/src/main/resources/ocaml/model.mustache index 161a2129d46..cbd93f1524b 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/model.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/model.mustache @@ -43,7 +43,7 @@ type t = { ; [@key "{{{baseName}}}"] {{/isEnum}} {{/vars}} -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; {{#description}} (** {{{.}}} *) diff --git a/samples/client/petstore/ocaml/src/models/api_response.ml b/samples/client/petstore/ocaml/src/models/api_response.ml index a656e6996a0..0abc8a37b74 100644 --- a/samples/client/petstore/ocaml/src/models/api_response.ml +++ b/samples/client/petstore/ocaml/src/models/api_response.ml @@ -22,7 +22,7 @@ type t = { option [@default None] ; [@key "message"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** Describes the result of uploading an image resource *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/category.ml b/samples/client/petstore/ocaml/src/models/category.ml index c5edc5108e1..47b8f3bee0e 100644 --- a/samples/client/petstore/ocaml/src/models/category.ml +++ b/samples/client/petstore/ocaml/src/models/category.ml @@ -17,7 +17,7 @@ type t = { option [@default None] ; [@key "name"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** A category for a pet *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/order.ml b/samples/client/petstore/ocaml/src/models/order.ml index 2849bc75a7e..f88bd155f70 100644 --- a/samples/client/petstore/ocaml/src/models/order.ml +++ b/samples/client/petstore/ocaml/src/models/order.ml @@ -39,7 +39,7 @@ type t = { option [@default None] ; [@key "complete"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** An order for a pets from the pet store *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/pet.ml b/samples/client/petstore/ocaml/src/models/pet.ml index fb3972dd65a..34001310d29 100644 --- a/samples/client/petstore/ocaml/src/models/pet.ml +++ b/samples/client/petstore/ocaml/src/models/pet.ml @@ -35,7 +35,7 @@ type t = { None ] ; [@key "status"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** A pet for sale in the pet store *) let create (name : string) (photo_urls : string list) : t = { diff --git a/samples/client/petstore/ocaml/src/models/tag.ml b/samples/client/petstore/ocaml/src/models/tag.ml index 349b43829fb..9c89a1d1e05 100644 --- a/samples/client/petstore/ocaml/src/models/tag.ml +++ b/samples/client/petstore/ocaml/src/models/tag.ml @@ -17,7 +17,7 @@ type t = { option [@default None] ; [@key "name"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** A tag for a pet *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/user.ml b/samples/client/petstore/ocaml/src/models/user.ml index 342089254b8..38ed8cce2dd 100644 --- a/samples/client/petstore/ocaml/src/models/user.ml +++ b/samples/client/petstore/ocaml/src/models/user.ml @@ -48,7 +48,7 @@ type t = { option [@default None] ; [@key "userStatus"] -} [@@deriving yojson { strict = false }, show ];; +} [@@deriving yojson { strict = false }, show, eq ];; (** A User who is purchasing from the pet store *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/support/enums.ml b/samples/client/petstore/ocaml/src/support/enums.ml index 0c64f8c042f..4e4c2d61edc 100644 --- a/samples/client/petstore/ocaml/src/support/enums.ml +++ b/samples/client/petstore/ocaml/src/support/enums.ml @@ -9,7 +9,7 @@ type status = [ | `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] | `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] | `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] -] [@@deriving yojson, show { with_path = false }];; +] [@@deriving yojson, show { with_path = false }, eq];; let status_of_yojson json = status_of_yojson (`List [json]) let status_to_yojson e = @@ -21,7 +21,7 @@ type pet_status = [ | `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] | `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] | `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] -] [@@deriving yojson, show { with_path = false }];; +] [@@deriving yojson, show { with_path = false }, eq];; let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) let pet_status_to_yojson e =