@@ -120,19 +120,29 @@ def test_open_api_route_get_openapi_operation_parameters_works_for_empty_model_n
120
120
"name" : "car_id" ,
121
121
"in" : "path" ,
122
122
"required" : True ,
123
- "schema" : {"title" : "Car Id" , "type" : "integer" },
123
+ "schema" : {"title" : "Car Id" , "include_in_schema" : True , " type" : "integer" },
124
124
},
125
125
{
126
126
"name" : "to" ,
127
127
"in" : "query" ,
128
128
"required" : False ,
129
- "schema" : {"title" : "To" , "type" : "string" , "format" : "date-time" },
129
+ "schema" : {
130
+ "title" : "To" ,
131
+ "include_in_schema" : True ,
132
+ "type" : "string" ,
133
+ "format" : "date-time" ,
134
+ },
130
135
},
131
136
{
132
137
"name" : "from" ,
133
138
"in" : "query" ,
134
139
"required" : False ,
135
- "schema" : {"title" : "From" , "type" : "string" , "format" : "date-time" },
140
+ "schema" : {
141
+ "title" : "From" ,
142
+ "include_in_schema" : True ,
143
+ "type" : "string" ,
144
+ "format" : "date-time" ,
145
+ },
136
146
},
137
147
]
138
148
@@ -161,12 +171,16 @@ def test_open_api_route_get_openapi_operation_request_body():
161
171
model_name_map = model_name_map
162
172
)
163
173
assert result == {
164
- "required" : True ,
165
174
"content" : {
166
175
"application/json" : {
167
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
176
+ "schema" : {
177
+ "allOf" : [{"$ref" : "#/components/schemas/CreateCarSchema" }],
178
+ "include_in_schema" : True ,
179
+ "title" : "Car" ,
180
+ }
168
181
}
169
182
},
183
+ "required" : True ,
170
184
}
171
185
172
186
@@ -190,7 +204,11 @@ def test_open_api_route_get_child_openapi_path():
190
204
"required" : True ,
191
205
"content" : {
192
206
"application/json" : {
193
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
207
+ "schema" : {
208
+ "title" : "Car" ,
209
+ "include_in_schema" : True ,
210
+ "allOf" : [{"$ref" : "#/components/schemas/CreateCarSchema" }],
211
+ }
194
212
}
195
213
},
196
214
},
@@ -245,7 +263,13 @@ def test_open_api_route_get_openapi_path():
245
263
"required" : True ,
246
264
"content" : {
247
265
"application/json" : {
248
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
266
+ "schema" : {
267
+ "title" : "Car" ,
268
+ "include_in_schema" : True ,
269
+ "allOf" : [
270
+ {"$ref" : "#/components/schemas/CreateCarSchema" }
271
+ ],
272
+ }
249
273
}
250
274
},
251
275
},
@@ -295,7 +319,13 @@ def test_open_api_route_get_openapi_path():
295
319
"required" : True ,
296
320
"content" : {
297
321
"application/json" : {
298
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
322
+ "schema" : {
323
+ "title" : "Car" ,
324
+ "include_in_schema" : True ,
325
+ "allOf" : [
326
+ {"$ref" : "#/components/schemas/CreateCarSchema" }
327
+ ],
328
+ }
299
329
}
300
330
},
301
331
},
@@ -365,7 +395,13 @@ def test_open_api_route_get_openapi_path_with_security():
365
395
"required" : True ,
366
396
"content" : {
367
397
"application/json" : {
368
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
398
+ "schema" : {
399
+ "title" : "Car" ,
400
+ "include_in_schema" : True ,
401
+ "allOf" : [
402
+ {"$ref" : "#/components/schemas/CreateCarSchema" }
403
+ ],
404
+ }
369
405
}
370
406
},
371
407
},
@@ -412,13 +448,17 @@ def test_open_api_route__get_openapi_path_object_works_for_routes_with_multiple_
412
448
result = openapi_route_doc ._get_openapi_path_object (model_name_map = model_name_map )
413
449
assert isinstance (result , tuple )
414
450
assert result [0 ] == {
415
- "post " : {
451
+ "get " : {
416
452
"summary" : None ,
417
- "operationId" : "list_and_create_car_list_post " ,
453
+ "operationId" : "list_and_create_car_list_get " ,
418
454
"requestBody" : {
419
455
"content" : {
420
456
"application/json" : {
421
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
457
+ "schema" : {
458
+ "title" : "Car" ,
459
+ "include_in_schema" : True ,
460
+ "allOf" : [{"$ref" : "#/components/schemas/CreateCarSchema" }],
461
+ }
422
462
}
423
463
}
424
464
},
@@ -444,13 +484,17 @@ def test_open_api_route__get_openapi_path_object_works_for_routes_with_multiple_
444
484
},
445
485
},
446
486
},
447
- "get " : {
487
+ "post " : {
448
488
"summary" : None ,
449
- "operationId" : "list_and_create_car_list_get " ,
489
+ "operationId" : "list_and_create_car_list_post " ,
450
490
"requestBody" : {
451
491
"content" : {
452
492
"application/json" : {
453
- "schema" : {"$ref" : "#/components/schemas/CreateCarSchema" }
493
+ "schema" : {
494
+ "title" : "Car" ,
495
+ "include_in_schema" : True ,
496
+ "allOf" : [{"$ref" : "#/components/schemas/CreateCarSchema" }],
497
+ }
454
498
}
455
499
}
456
500
},
0 commit comments