@@ -27,71 +27,146 @@ let fake_http_signature_test ~pet_t ?query_1 ?header_1 () =
27
27
header_1 in
28
28
let uri = Request. maybe_add_query_param uri " query_1" (fun x -> x)
29
29
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
31
39
Cohttp_lwt_unix.Client. call `GET uri ~headers ~body >> = fun (resp , body ) ->
32
40
Request. handle_unit_response resp
33
41
34
42
let fake_outer_boolean_serialize ~body () =
35
43
let open Lwt.Infix in
36
44
let uri = Request. build_uri " /fake/outer/boolean" in
37
45
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
39
54
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
40
55
Request. read_json_body_as (JsonSupport. to_bool) resp body
41
56
42
57
let fake_outer_composite_serialize ~outer_composite_t () =
43
58
let open Lwt.Infix in
44
59
let uri = Request. build_uri " /fake/outer/composite" in
45
60
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
47
70
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
48
71
Request. read_json_body_as (JsonSupport. unwrap Outer_composite. of_yojson) resp body
49
72
50
73
let fake_outer_number_serialize ~body () =
51
74
let open Lwt.Infix in
52
75
let uri = Request. build_uri " /fake/outer/number" in
53
76
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
55
85
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
56
86
Request. read_json_body_as (JsonSupport. to_float) resp body
57
87
58
88
let fake_outer_string_serialize ~body () =
59
89
let open Lwt.Infix in
60
90
let uri = Request. build_uri " /fake/outer/string" in
61
91
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
63
100
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
64
101
Request. read_json_body_as (JsonSupport. to_string) resp body
65
102
66
103
let fake_property_enum_integer_serialize ~outer_object_with_enum_property_t =
67
104
let open Lwt.Infix in
68
105
let uri = Request. build_uri " /fake/property/enum-int" in
69
106
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
71
116
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
72
117
Request. read_json_body_as (JsonSupport. unwrap Outer_object_with_enum_property. of_yojson) resp body
73
118
74
119
let test_additional_properties_reference ~request_body =
75
120
let open Lwt.Infix in
76
121
let uri = Request. build_uri " /fake/additionalProperties-reference" in
77
122
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
79
139
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
80
140
Request. handle_unit_response resp
81
141
82
142
let test_body_with_binary ~body =
83
143
let open Lwt.Infix in
84
144
let uri = Request. build_uri " /fake/body-with-binary" in
85
145
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
87
154
Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
88
155
Request. handle_unit_response resp
89
156
90
157
let test_body_with_file_schema ~file_schema_test_class_t =
91
158
let open Lwt.Infix in
92
159
let uri = Request. build_uri " /fake/body-with-file-schema" in
93
160
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
95
170
Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
96
171
Request. handle_unit_response resp
97
172
@@ -101,15 +176,31 @@ let test_body_with_query_params ~query ~user_t =
101
176
let headers = Request. default_headers in
102
177
let uri = Request. add_query_param uri " query" (fun x -> x)
103
178
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
105
188
Cohttp_lwt_unix.Client. call `PUT uri ~headers ~body >> = fun (resp , body ) ->
106
189
Request. handle_unit_response resp
107
190
108
191
let test_client_model ~client_t =
109
192
let open Lwt.Infix in
110
193
let uri = Request. build_uri " /fake" in
111
194
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
113
204
Cohttp_lwt_unix.Client. call `PATCH uri ~headers ~body >> = fun (resp , body ) ->
114
205
Request. read_json_body_as (JsonSupport. unwrap Client. of_yojson) resp body
115
206
@@ -204,15 +295,38 @@ let test_inline_additional_properties ~request_body =
204
295
let open Lwt.Infix in
205
296
let uri = Request. build_uri " /fake/inline-additionalProperties" in
206
297
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
208
314
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
209
315
Request. handle_unit_response resp
210
316
211
317
let test_inline_freeform_additional_properties ~test_inline_freeform_additional_properties_request_t =
212
318
let open Lwt.Infix in
213
319
let uri = Request. build_uri " /fake/inline-freeform-additionalProperties" in
214
320
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
216
330
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
217
331
Request. handle_unit_response resp
218
332
@@ -233,7 +347,15 @@ let test_nullable ~child_with_nullable_t =
233
347
let open Lwt.Infix in
234
348
let uri = Request. build_uri " /fake/nullable" in
235
349
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
237
359
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
238
360
Request. handle_unit_response resp
239
361
@@ -268,7 +390,22 @@ let test_string_map_reference ~request_body =
268
390
let open Lwt.Infix in
269
391
let uri = Request. build_uri " /fake/stringMap-reference" in
270
392
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
272
409
Cohttp_lwt_unix.Client. call `POST uri ~headers ~body >> = fun (resp , body ) ->
273
410
Request. handle_unit_response resp
274
411
0 commit comments