forked from loafle/openapi-generator-original
* Add key to each model field Add a `[@key "someField"]` annotation to each model field, to avoid mismatches when the JSON field is not in snake_case. Closes https://github.com/OpenAPITools/openapi-generator/issues/20765 * update ocaml samples --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
29 lines
821 B
OCaml
29 lines
821 B
OCaml
(*
|
|
* This file has been generated by the OCamlClientCodegen generator for openapi-generator.
|
|
*
|
|
* Generated by: https://openapi-generator.tech
|
|
*
|
|
* Schema Pet.t : A pet for sale in the pet store
|
|
*)
|
|
|
|
type t = {
|
|
id: int64 option [@default None]; [@key "id"]
|
|
category: Category.t option [@default None]; [@key "category"]
|
|
name: string; [@key "name"]
|
|
photo_urls: string list; [@key "photoUrls"]
|
|
tags: Tag.t list; [@key "tags"]
|
|
(* pet status in the store *)
|
|
status: Enums.pet_status option [@default None]; [@key "status"]
|
|
} [@@deriving yojson { strict = false }, show ];;
|
|
|
|
(** A pet for sale in the pet store *)
|
|
let create (name : string) (photo_urls : string list) : t = {
|
|
id = None;
|
|
category = None;
|
|
name = name;
|
|
photo_urls = photo_urls;
|
|
tags = [];
|
|
status = None;
|
|
}
|
|
|