@@ -27,71 +27,146 @@ 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 Pet. to_yojson pet_t in
30+ let body = Request. write_as_json_body
31+
32+
33+
34+
35+
36+
37+ Pet. to_yojson
38+ pet_t in
3139 Cohttp_lwt_unix.Client. call `GET uri ~headers ~body >> = fun (resp , body ) ->
3240 Request. handle_unit_response resp
3341
3442let fake_outer_boolean_serialize ~body () =
3543 let open Lwt.Infix in
3644 let uri = Request. build_uri " /fake/outer/boolean" in
3745 let headers = Request. default_headers in
38- let body = Request. write_as_json_body JsonSupport. of_bool body in
46+ let body = Request. write_as_json_body
47+
48+
49+
50+
51+
52+ JsonSupport. of_bool
53+ body in
3954 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
4055 Request. read_json_body_as (JsonSupport. to_bool) resp body
4156
4257let fake_outer_composite_serialize ~outer_composite_t () =
4358 let open Lwt.Infix in
4459 let uri = Request. build_uri " /fake/outer/composite" in
4560 let headers = Request. default_headers in
46- let body = Request. write_as_json_body Outer_composite. to_yojson outer_composite_t in
61+ let body = Request. write_as_json_body
62+
63+
64+
65+
66+
67+
68+ Outer_composite. to_yojson
69+ outer_composite_t in
4770 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
4871 Request. read_json_body_as (JsonSupport. unwrap Outer_composite. of_yojson) resp body
4972
5073let fake_outer_number_serialize ~body () =
5174 let open Lwt.Infix in
5275 let uri = Request. build_uri " /fake/outer/number" in
5376 let headers = Request. default_headers in
54- let body = Request. write_as_json_body JsonSupport. of_float body in
77+ let body = Request. write_as_json_body
78+
79+
80+
81+ JsonSupport. of_float
82+
83+
84+ body in
5585 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
5686 Request. read_json_body_as (JsonSupport. to_float) resp body
5787
5888let fake_outer_string_serialize ~body () =
5989 let open Lwt.Infix in
6090 let uri = Request. build_uri " /fake/outer/string" in
6191 let headers = Request. default_headers in
62- let body = Request. write_as_json_body JsonSupport. of_string body in
92+ let body = Request. write_as_json_body JsonSupport. of_string
93+
94+
95+
96+
97+
98+
99+ body in
63100 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
64101 Request. read_json_body_as (JsonSupport. to_string) resp body
65102
66103let fake_property_enum_integer_serialize ~outer_object_with_enum_property_t =
67104 let open Lwt.Infix in
68105 let uri = Request. build_uri " /fake/property/enum-int" in
69106 let headers = Request. default_headers in
70- let body = Request. write_as_json_body Outer_object_with_enum_property. to_yojson outer_object_with_enum_property_t in
107+ let body = Request. write_as_json_body
108+
109+
110+
111+
112+
113+
114+ Outer_object_with_enum_property. to_yojson
115+ outer_object_with_enum_property_t in
71116 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
72117 Request. read_json_body_as (JsonSupport. unwrap Outer_object_with_enum_property. of_yojson) resp body
73118
74119let test_additional_properties_reference ~request_body =
75120 let open Lwt.Infix in
76121 let uri = Request. build_uri " /fake/additionalProperties-reference" in
77122 let headers = Request. default_headers in
78- let body = Request. write_json_body (JsonSupport. of_map_of ) request_body in
123+ let body = Request. write_json_body (JsonSupport. of_map_of
124+
125+
126+
127+
128+
129+
130+ )
131+
132+
133+
134+
135+
136+
137+
138+ request_body in
79139 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
80140 Request. handle_unit_response resp
81141
82142let test_body_with_binary ~body =
83143 let open Lwt.Infix in
84144 let uri = Request. build_uri " /fake/body-with-binary" in
85145 let headers = Request. default_headers in
86- let body = Request. write_as_json_body body in
146+ let body = Request. write_as_json_body
147+
148+
149+
150+
151+
152+
153+ body in
87154 Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
88155 Request. handle_unit_response resp
89156
90157let test_body_with_file_schema ~file_schema_test_class_t =
91158 let open Lwt.Infix in
92159 let uri = Request. build_uri " /fake/body-with-file-schema" in
93160 let headers = Request. default_headers in
94- let body = Request. write_as_json_body File_schema_test_class. to_yojson file_schema_test_class_t in
161+ let body = Request. write_as_json_body
162+
163+
164+
165+
166+
167+
168+ File_schema_test_class. to_yojson
169+ file_schema_test_class_t in
95170 Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
96171 Request. handle_unit_response resp
97172
@@ -101,15 +176,31 @@ let test_body_with_query_params ~query ~user_t =
101176 let headers = Request. default_headers in
102177 let uri = Request. add_query_param uri " query" (fun x -> x)
103178 query in
104- let body = Request. write_as_json_body User. to_yojson user_t in
179+ let body = Request. write_as_json_body
180+
181+
182+
183+
184+
185+
186+ User. to_yojson
187+ user_t in
105188 Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
106189 Request. handle_unit_response resp
107190
108191let test_client_model ~client_t =
109192 let open Lwt.Infix in
110193 let uri = Request. build_uri " /fake" in
111194 let headers = Request. default_headers in
112- let body = Request. write_as_json_body Client. to_yojson client_t in
195+ let body = Request. write_as_json_body
196+
197+
198+
199+
200+
201+
202+ Client. to_yojson
203+ client_t in
113204 Cohttp_lwt_unix.Client. call `PATCH uri ~headers ~body >> = fun (resp , body ) ->
114205 Request. read_json_body_as (JsonSupport. unwrap Client. of_yojson) resp body
115206
@@ -204,15 +295,38 @@ let test_inline_additional_properties ~request_body =
204295 let open Lwt.Infix in
205296 let uri = Request. build_uri " /fake/inline-additionalProperties" in
206297 let headers = Request. default_headers in
207- let body = Request. write_as_json_body (JsonSupport. of_map_of JsonSupport. of_string) request_body in
298+ let body = Request. write_as_json_body (JsonSupport. of_map_of JsonSupport. of_string
299+
300+
301+
302+
303+
304+
305+ )
306+
307+
308+
309+
310+
311+
312+
313+ request_body in
208314 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
209315 Request. handle_unit_response resp
210316
211317let test_inline_freeform_additional_properties ~test_inline_freeform_additional_properties_request_t =
212318 let open Lwt.Infix in
213319 let uri = Request. build_uri " /fake/inline-freeform-additionalProperties" in
214320 let headers = Request. default_headers in
215- let body = Request. write_as_json_body Test_inline_freeform_additional_properties_request. to_yojson test_inline_freeform_additional_properties_request_t in
321+ let body = Request. write_as_json_body
322+
323+
324+
325+
326+
327+
328+ Test_inline_freeform_additional_properties_request. to_yojson
329+ test_inline_freeform_additional_properties_request_t in
216330 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
217331 Request. handle_unit_response resp
218332
@@ -233,7 +347,15 @@ let test_nullable ~child_with_nullable_t =
233347 let open Lwt.Infix in
234348 let uri = Request. build_uri " /fake/nullable" in
235349 let headers = Request. default_headers in
236- let body = Request. write_as_json_body Child_with_nullable. to_yojson child_with_nullable_t in
350+ let body = Request. write_as_json_body
351+
352+
353+
354+
355+
356+
357+ Child_with_nullable. to_yojson
358+ child_with_nullable_t in
237359 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
238360 Request. handle_unit_response resp
239361
@@ -268,7 +390,22 @@ let test_string_map_reference ~request_body =
268390 let open Lwt.Infix in
269391 let uri = Request. build_uri " /fake/stringMap-reference" in
270392 let headers = Request. default_headers in
271- let body = Request. write_as_json_body (JsonSupport. of_map_of JsonSupport. of_string) request_body in
393+ let body = Request. write_as_json_body (JsonSupport. of_map_of JsonSupport. of_string
394+
395+
396+
397+
398+
399+
400+ )
401+
402+
403+
404+
405+
406+
407+
408+ request_body in
272409 Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
273410 Request. handle_unit_response resp
274411
0 commit comments