File tree 7 files changed +156
-29
lines changed
modules/openapi-generator/src/main/resources/ocaml
samples/client/petstore/ocaml/src/models
7 files changed +156
-29
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,31 @@ type t = {
16
16
(* { {{.} }} *)
17
17
{ {/description} }
18
18
{ {#isEnum} }
19
- { {{name} }}: { {^isMap} }Enums.{ {/isMap} }{ {{datatypeWithEnum} }}{ {^isContainer} }{ {#required} }{ {#defaultValue} }[@default { {{.} }}]{ {/defaultValue} }{ {/required} }{ {/isContainer} }{ {^isContainer} }{ {#required} }{ {#isNullable} } option [@default { {#defaultValue} }Some({ {{.} }}){ {/defaultValue} }{ {^defaultValue} }None{ {/defaultValue} }]{ {/isNullable} }{ {/required} }{ {/isContainer} }{ {^isContainer} }{ {^required} } option [@default { {#defaultValue} }Some({ {{.} }}){ {/defaultValue} }{ {^defaultValue} }None{ {/defaultValue} }]{ {/required} }{ {/isContainer} }; [@key "{ {{baseName} }}"]
19
+ { {{name} }}: { {^isMap} }Enums.{ {/isMap} }{ {{datatypeWithEnum} }}
20
+ { {^isContainer} }
21
+ { {#required} }
22
+ { {#defaultValue} }[@default { {{.} }}]{ {/defaultValue} }
23
+ { {#isNullable} } option [@default
24
+ { {#defaultValue} }Some({ {{.} }}){ {/defaultValue} }
25
+ { {^defaultValue} }None{ {/defaultValue} }
26
+ ]
27
+ { {/isNullable} }
28
+ { {/required} }
29
+ { {^required} } option [@default
30
+ { {#defaultValue} }Some({ {{.} }}){ {/defaultValue} }
31
+ { {^defaultValue} }None{ {/defaultValue} }
32
+ ]
33
+ { {/required} }
34
+ { {/isContainer} }; [@key "{ {{baseName} }}"]
20
35
{ {/isEnum} }
21
36
{ {^isEnum} }
22
- { {{name} }}: { {{datatypeWithEnum} }}{ {^isContainer} }{ {#required} }{ {#isNullable} } option{ {/isNullable} }{ {/required} }{ {/isContainer} }{ {^isContainer} }{ {^required} } option [@default None]{ {/required} }{ {/isContainer} }; [@key "{ {{baseName} }}"]
37
+ { {{name} }}: { {{datatypeWithEnum} }}
38
+ { {^isContainer} }
39
+ { {#required} }{ {#isNullable} } option{ {/isNullable} }{ {/required} }
40
+ { {^required} } option [@default None]{ {/required} }
41
+ { {/isContainer} }
42
+ { {#isArray} }{ {^required} } [@default []]{ {/required} }{ {/isArray} }
43
+ ; [@key "{ {{baseName} }}"]
23
44
{ {/isEnum} }
24
45
{ {/vars} }
25
46
} [@@deriving yojson { strict = false } , show ];;
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- code : int32 option [@ default None ]; [@ key " code" ]
11
- _type : string option [@ default None ]; [@ key " type" ]
12
- message : string option [@ default None ]; [@ key " message" ]
10
+ code : int32
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " code" ]
15
+ _type : string
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " type" ]
20
+ message : string
21
+
22
+ option [@ default None ]
23
+
24
+ ; [@ key " message" ]
13
25
} [@@ deriving yojson { strict = false }, show ];;
14
26
15
27
(* * Describes the result of uploading an image resource *)
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- id : int64 option [@ default None ]; [@ key " id" ]
11
- name : string option [@ default None ]; [@ key " name" ]
10
+ id : int64
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " id" ]
15
+ name : string
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " name" ]
12
20
} [@@ deriving yojson { strict = false }, show ];;
13
21
14
22
(* * A category for a pet *)
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- id : int64 option [@ default None ]; [@ key " id" ]
11
- pet_id : int64 option [@ default None ]; [@ key " petId" ]
12
- quantity : int32 option [@ default None ]; [@ key " quantity" ]
13
- ship_date : string option [@ default None ]; [@ key " shipDate" ]
10
+ id : int64
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " id" ]
15
+ pet_id : int64
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " petId" ]
20
+ quantity : int32
21
+
22
+ option [@ default None ]
23
+
24
+ ; [@ key " quantity" ]
25
+ ship_date : string
26
+
27
+ option [@ default None ]
28
+
29
+ ; [@ key " shipDate" ]
14
30
(* Order Status *)
15
- status : Enums .status option [@ default None ]; [@ key " status" ]
16
- complete : bool option [@ default None ]; [@ key " complete" ]
31
+ status : Enums .status
32
+ option [@ default
33
+
34
+ None
35
+ ]
36
+ ; [@ key " status" ]
37
+ complete : bool
38
+
39
+ option [@ default None ]
40
+
41
+ ; [@ key " complete" ]
17
42
} [@@ deriving yojson { strict = false }, show ];;
18
43
19
44
(* * An order for a pets from the pet store *)
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- id : int64 option [@ default None ]; [@ key " id" ]
11
- category : Category .t option [@ default None ]; [@ key " category" ]
12
- name : string ; [@ key " name" ]
13
- photo_urls : string list ; [@ key " photoUrls" ]
14
- tags : Tag .t list ; [@ key " tags" ]
10
+ id : int64
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " id" ]
15
+ category : Category .t
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " category" ]
20
+ name : string
21
+
22
+
23
+
24
+ ; [@ key " name" ]
25
+ photo_urls : string list
26
+
27
+ ; [@ key " photoUrls" ]
28
+ tags : Tag .t list
29
+ [@ default []]
30
+ ; [@ key " tags" ]
15
31
(* pet status in the store *)
16
- status : Enums .pet_status option [@ default None ]; [@ key " status" ]
32
+ status : Enums .pet_status
33
+ option [@ default
34
+
35
+ None
36
+ ]
37
+ ; [@ key " status" ]
17
38
} [@@ deriving yojson { strict = false }, show ];;
18
39
19
40
(* * A pet for sale in the pet store *)
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- id : int64 option [@ default None ]; [@ key " id" ]
11
- name : string option [@ default None ]; [@ key " name" ]
10
+ id : int64
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " id" ]
15
+ name : string
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " name" ]
12
20
} [@@ deriving yojson { strict = false }, show ];;
13
21
14
22
(* * A tag for a pet *)
Original file line number Diff line number Diff line change 7
7
*)
8
8
9
9
type t = {
10
- id : int64 option [@ default None ]; [@ key " id" ]
11
- username : string option [@ default None ]; [@ key " username" ]
12
- first_name : string option [@ default None ]; [@ key " firstName" ]
13
- last_name : string option [@ default None ]; [@ key " lastName" ]
14
- email : string option [@ default None ]; [@ key " email" ]
15
- password : string option [@ default None ]; [@ key " password" ]
16
- phone : string option [@ default None ]; [@ key " phone" ]
10
+ id : int64
11
+
12
+ option [@ default None ]
13
+
14
+ ; [@ key " id" ]
15
+ username : string
16
+
17
+ option [@ default None ]
18
+
19
+ ; [@ key " username" ]
20
+ first_name : string
21
+
22
+ option [@ default None ]
23
+
24
+ ; [@ key " firstName" ]
25
+ last_name : string
26
+
27
+ option [@ default None ]
28
+
29
+ ; [@ key " lastName" ]
30
+ email : string
31
+
32
+ option [@ default None ]
33
+
34
+ ; [@ key " email" ]
35
+ password : string
36
+
37
+ option [@ default None ]
38
+
39
+ ; [@ key " password" ]
40
+ phone : string
41
+
42
+ option [@ default None ]
43
+
44
+ ; [@ key " phone" ]
17
45
(* User Status *)
18
- user_status : int32 option [@ default None ]; [@ key " userStatus" ]
46
+ user_status : int32
47
+
48
+ option [@ default None ]
49
+
50
+ ; [@ key " userStatus" ]
19
51
} [@@ deriving yojson { strict = false }, show ];;
20
52
21
53
(* * A User who is purchasing from the pet store *)
You can’t perform that action at this time.
0 commit comments