Skip to content

Commit 3ea004a

Browse files
committed
Indent api-impl.mustache a bit more for readability before fix
1 parent 675ba32 commit 3ea004a

File tree

12 files changed

+274
-54
lines changed

12 files changed

+274
-54
lines changed

modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ let {{{operationId}}} {{^hasParams}}(){{/hasParams}}{{#allParams}}{{> to_param}}
4242
{{/authMethods}}
4343
{{/hasAuthMethods}}
4444
{{#bodyParams}}
45-
let body = Request.{{#isFreeFormObject}}write_json_body{{/isFreeFormObject}}{{#isByteArray}}write_string_body{{/isByteArray}}{{^isFreeFormObject}}{{^isByteArray}}write_as_json_body{{/isByteArray}}{{/isFreeFormObject}} {{> to_json}} {{{paramName}}} in
45+
let body = Request.
46+
{{#isFreeFormObject}}write_json_body{{/isFreeFormObject}}
47+
{{#isByteArray}}write_string_body{{/isByteArray}}
48+
{{^isFreeFormObject}}{{^isByteArray}}write_as_json_body{{/isByteArray}}{{/isFreeFormObject}}
49+
{{> to_json}} {{{paramName}}} in
4650
{{/bodyParams}}
4751
{{^hasBodyParam}}
4852
{{#hasFormParams}}

samples/client/petstore/ocaml-fake-petstore/src/apis/another_fake_api.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ let call_123_test_special_tags ~client_t =
99
let open Lwt.Infix in
1010
let uri = Request.build_uri "/another-fake/dummy" in
1111
let headers = Request.default_headers in
12-
let body = Request.write_as_json_body
12+
let body = Request.
13+
14+
15+
write_as_json_body
16+
1317

1418

1519

samples/client/petstore/ocaml-fake-petstore/src/apis/fake_api.ml

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ let fake_http_signature_test ~pet_t ?query_1 ?header_1 () =
2727
header_1 in
2828
let uri = Request.maybe_add_query_param uri "query_1" (fun x -> x)
2929
query_1 in
30-
let body = Request.write_as_json_body
30+
let body = Request.
31+
32+
33+
write_as_json_body
34+
3135

3236

3337

@@ -43,7 +47,11 @@ let fake_outer_boolean_serialize ~body () =
4347
let open Lwt.Infix in
4448
let uri = Request.build_uri "/fake/outer/boolean" in
4549
let headers = Request.default_headers in
46-
let body = Request.write_as_json_body
50+
let body = Request.
51+
52+
53+
write_as_json_body
54+
4755

4856

4957

@@ -58,7 +66,11 @@ let fake_outer_composite_serialize ~outer_composite_t () =
5866
let open Lwt.Infix in
5967
let uri = Request.build_uri "/fake/outer/composite" in
6068
let headers = Request.default_headers in
61-
let body = Request.write_as_json_body
69+
let body = Request.
70+
71+
72+
write_as_json_body
73+
6274

6375

6476

@@ -74,7 +86,11 @@ let fake_outer_number_serialize ~body () =
7486
let open Lwt.Infix in
7587
let uri = Request.build_uri "/fake/outer/number" in
7688
let headers = Request.default_headers in
77-
let body = Request.write_as_json_body
89+
let body = Request.
90+
91+
92+
write_as_json_body
93+
7894

7995

8096

@@ -89,7 +105,11 @@ let fake_outer_string_serialize ~body () =
89105
let open Lwt.Infix in
90106
let uri = Request.build_uri "/fake/outer/string" in
91107
let headers = Request.default_headers in
92-
let body = Request.write_as_json_body JsonSupport.of_string
108+
let body = Request.
109+
110+
111+
write_as_json_body
112+
JsonSupport.of_string
93113

94114

95115

@@ -104,7 +124,11 @@ let fake_property_enum_integer_serialize ~outer_object_with_enum_property_t =
104124
let open Lwt.Infix in
105125
let uri = Request.build_uri "/fake/property/enum-int" in
106126
let headers = Request.default_headers in
107-
let body = Request.write_as_json_body
127+
let body = Request.
128+
129+
130+
write_as_json_body
131+
108132

109133

110134

@@ -120,7 +144,11 @@ let test_additional_properties_reference ~request_body =
120144
let open Lwt.Infix in
121145
let uri = Request.build_uri "/fake/additionalProperties-reference" in
122146
let headers = Request.default_headers in
123-
let body = Request.write_json_body (JsonSupport.of_map_of
147+
let body = Request.
148+
write_json_body
149+
150+
151+
(JsonSupport.of_map_of
124152

125153

126154

@@ -143,7 +171,11 @@ let test_body_with_binary ~body =
143171
let open Lwt.Infix in
144172
let uri = Request.build_uri "/fake/body-with-binary" in
145173
let headers = Request.default_headers in
146-
let body = Request.write_as_json_body
174+
let body = Request.
175+
176+
177+
write_as_json_body
178+
147179

148180

149181

@@ -158,7 +190,11 @@ let test_body_with_file_schema ~file_schema_test_class_t =
158190
let open Lwt.Infix in
159191
let uri = Request.build_uri "/fake/body-with-file-schema" in
160192
let headers = Request.default_headers in
161-
let body = Request.write_as_json_body
193+
let body = Request.
194+
195+
196+
write_as_json_body
197+
162198

163199

164200

@@ -176,7 +212,11 @@ let test_body_with_query_params ~query ~user_t =
176212
let headers = Request.default_headers in
177213
let uri = Request.add_query_param uri "query" (fun x -> x)
178214
query in
179-
let body = Request.write_as_json_body
215+
let body = Request.
216+
217+
218+
write_as_json_body
219+
180220

181221

182222

@@ -192,7 +232,11 @@ let test_client_model ~client_t =
192232
let open Lwt.Infix in
193233
let uri = Request.build_uri "/fake" in
194234
let headers = Request.default_headers in
195-
let body = Request.write_as_json_body
235+
let body = Request.
236+
237+
238+
write_as_json_body
239+
196240

197241

198242

@@ -295,7 +339,11 @@ let test_inline_additional_properties ~request_body =
295339
let open Lwt.Infix in
296340
let uri = Request.build_uri "/fake/inline-additionalProperties" in
297341
let headers = Request.default_headers in
298-
let body = Request.write_as_json_body (JsonSupport.of_map_of JsonSupport.of_string
342+
let body = Request.
343+
344+
345+
write_as_json_body
346+
(JsonSupport.of_map_of JsonSupport.of_string
299347

300348

301349

@@ -318,7 +366,11 @@ let test_inline_freeform_additional_properties ~test_inline_freeform_additional_
318366
let open Lwt.Infix in
319367
let uri = Request.build_uri "/fake/inline-freeform-additionalProperties" in
320368
let headers = Request.default_headers in
321-
let body = Request.write_as_json_body
369+
let body = Request.
370+
371+
372+
write_as_json_body
373+
322374

323375

324376

@@ -347,7 +399,11 @@ let test_nullable ~child_with_nullable_t =
347399
let open Lwt.Infix in
348400
let uri = Request.build_uri "/fake/nullable" in
349401
let headers = Request.default_headers in
350-
let body = Request.write_as_json_body
402+
let body = Request.
403+
404+
405+
write_as_json_body
406+
351407

352408

353409

@@ -390,7 +446,11 @@ let test_string_map_reference ~request_body =
390446
let open Lwt.Infix in
391447
let uri = Request.build_uri "/fake/stringMap-reference" in
392448
let headers = Request.default_headers in
393-
let body = Request.write_as_json_body (JsonSupport.of_map_of JsonSupport.of_string
449+
let body = Request.
450+
451+
452+
write_as_json_body
453+
(JsonSupport.of_map_of JsonSupport.of_string
394454

395455

396456

samples/client/petstore/ocaml-fake-petstore/src/apis/fake_classname_tags123_api.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ let test_classname ~client_t =
1010
let uri = Request.build_uri "/fake_classname_test" in
1111
let headers = Request.default_headers in
1212
let uri = Uri.add_query_param' uri ("api_key_query", Request.api_key) in
13-
let body = Request.write_as_json_body
13+
let body = Request.
14+
15+
16+
write_as_json_body
17+
1418

1519

1620

samples/client/petstore/ocaml-fake-petstore/src/apis/pet_api.ml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ let add_pet ~pet_t =
99
let open Lwt.Infix in
1010
let uri = Request.build_uri "/pet" in
1111
let headers = Request.default_headers in
12-
let body = Request.write_as_json_body
12+
let body = Request.
13+
14+
15+
write_as_json_body
16+
1317

1418

1519

@@ -66,7 +70,11 @@ let update_pet ~pet_t =
6670
let open Lwt.Infix in
6771
let uri = Request.build_uri "/pet" in
6872
let headers = Request.default_headers in
69-
let body = Request.write_as_json_body
73+
let body = Request.
74+
75+
76+
write_as_json_body
77+
7078

7179

7280

samples/client/petstore/ocaml-fake-petstore/src/apis/store_api.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ let place_order ~order_t =
3535
let open Lwt.Infix in
3636
let uri = Request.build_uri "/store/order" in
3737
let headers = Request.default_headers in
38-
let body = Request.write_as_json_body
38+
let body = Request.
39+
40+
41+
write_as_json_body
42+
3943

4044

4145

samples/client/petstore/ocaml-fake-petstore/src/apis/user_api.ml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ let create_user ~user_t =
99
let open Lwt.Infix in
1010
let uri = Request.build_uri "/user" in
1111
let headers = Request.default_headers in
12-
let body = Request.write_as_json_body
12+
let body = Request.
13+
14+
15+
write_as_json_body
16+
1317

1418

1519

@@ -25,7 +29,11 @@ let create_users_with_array_input ~user =
2529
let open Lwt.Infix in
2630
let uri = Request.build_uri "/user/createWithArray" in
2731
let headers = Request.default_headers in
28-
let body = Request.write_as_json_body (JsonSupport.of_list_of
32+
let body = Request.
33+
34+
35+
write_as_json_body
36+
(JsonSupport.of_list_of
2937

3038

3139

@@ -49,7 +57,11 @@ let create_users_with_list_input ~user =
4957
let open Lwt.Infix in
5058
let uri = Request.build_uri "/user/createWithList" in
5159
let headers = Request.default_headers in
52-
let body = Request.write_as_json_body (JsonSupport.of_list_of
60+
let body = Request.
61+
62+
63+
write_as_json_body
64+
(JsonSupport.of_list_of
5365

5466

5567

@@ -111,7 +123,11 @@ let update_user ~username ~user_t =
111123
let headers = Request.default_headers in
112124
let uri = Request.replace_path_param uri "username" (fun x -> x)
113125
username in
114-
let body = Request.write_as_json_body
126+
let body = Request.
127+
128+
129+
write_as_json_body
130+
115131

116132

117133

0 commit comments

Comments
 (0)