Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type t = {
; [@key "{{{baseName}}}"]
{{/isEnum}}
{{/vars}}
} [@@deriving yojson { strict = false }, show ];;
} [@@deriving yojson { strict = false }, show, eq ];;

{{#description}}
(** {{{.}}} *)
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/api_response.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/category.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/order.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/pet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/tag.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ocaml/src/models/user.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/ocaml/src/support/enums.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 =
Expand Down
Loading