forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsome_object.ml
More file actions
53 lines (40 loc) · 2.82 KB
/
some_object.ml
File metadata and controls
53 lines (40 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(*
* This file has been generated by the OCamlClientCodegen generator for openapi-generator.
*
* Generated by: https://openapi-generator.tech
*
*)
type t = {
required_field1: (string * Yojson.Safe.t) list
[@to_yojson JsonSupport.of_map_of [%to_yojson: Yojson.Safe.t]] [@of_yojson JsonSupport.to_map_of [%of_yojson: Yojson.Safe.t]]
; [@key "required_field1"]
(** Required, free-form *)
required_field2: (string * string) list
[@to_yojson JsonSupport.of_map_of [%to_yojson: string]] [@of_yojson JsonSupport.to_map_of [%of_yojson: string]]
; [@key "required_field2"]
(** Required, dictionary of strings *)
required_field3: (string * Some_object_required_field3_value.t) list
[@to_yojson JsonSupport.of_map_of [%to_yojson: Some_object_required_field3_value.t]] [@of_yojson JsonSupport.to_map_of [%of_yojson: Some_object_required_field3_value.t]]
; [@key "required_field3"]
(** Required, dictionary of objects *)
optional_field1: (string * Yojson.Safe.t) list
[@default []] [@to_yojson JsonSupport.of_map_of [%to_yojson: Yojson.Safe.t]] [@of_yojson JsonSupport.to_map_of [%of_yojson: Yojson.Safe.t]]
; [@key "optional_field1"]
(** Optional, free-form *)
optional_field2: (string * string) list
[@default []] [@to_yojson JsonSupport.of_map_of [%to_yojson: string]] [@of_yojson JsonSupport.to_map_of [%of_yojson: string]]
; [@key "optional_field2"]
(** Optional, dictionary of strings *)
optional_field3: (string * Some_object_required_field3_value.t) list
[@default []] [@to_yojson JsonSupport.of_map_of [%to_yojson: Some_object_required_field3_value.t]] [@of_yojson JsonSupport.to_map_of [%of_yojson: Some_object_required_field3_value.t]]
; [@key "optional_field3"]
(** Optional, dictionary of objects *)
} [@@deriving yojson { strict = false }, show, eq ];;
let create (required_field1 : (string * Yojson.Safe.t) list) (required_field2 : (string * string) list) (required_field3 : (string * Some_object_required_field3_value.t) list) : t = {
required_field1 = required_field1;
required_field2 = required_field2;
required_field3 = required_field3;
optional_field1 = [];
optional_field2 = [];
optional_field3 = [];
}