File tree 2 files changed +34
-6
lines changed
openapi_core/contrib/django
tests/integration/data/v3.0
2 files changed +34
-6
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,10 @@ def __call__(self, request):
31
31
openapi_request = self ._get_openapi_request (request )
32
32
req_result = self .validation_processor .process_request (openapi_request )
33
33
if req_result .errors :
34
- return self ._handle_request_errors (req_result , request )
35
-
36
- request .openapi = req_result
37
-
38
- response = self .get_response (request )
34
+ response = self ._handle_request_errors (req_result , request )
35
+ else :
36
+ request .openapi = req_result
37
+ response = self .get_response (request )
39
38
40
39
openapi_response = self ._get_openapi_response (response )
41
40
resp_result = self .validation_processor .process_response (
Original file line number Diff line number Diff line change 93
93
responses :
94
94
' 200 ' :
95
95
$ref : " #/components/responses/PetsResponse"
96
+ ' 400 ' :
97
+ $ref : " #/components/responses/ErrorResponse"
96
98
' 404 ' :
97
99
$ref : " #/components/responses/HtmlResponse"
98
100
post :
@@ -403,6 +405,31 @@ components:
403
405
default : 400
404
406
message :
405
407
type : string
408
+ StandardError :
409
+ type : object
410
+ x-model : StandardError
411
+ required :
412
+ - title
413
+ - status
414
+ - class
415
+ properties :
416
+ title :
417
+ type : string
418
+ status :
419
+ type : integer
420
+ format : int32
421
+ default : 400
422
+ class :
423
+ type : string
424
+ StandardErrors :
425
+ type : object
426
+ required :
427
+ - errors
428
+ properties :
429
+ errors :
430
+ type : array
431
+ items :
432
+ $ref : " #/components/schemas/StandardError"
406
433
ExtendedError :
407
434
type : object
408
435
x-model : ExtendedError
@@ -430,7 +457,9 @@ components:
430
457
content :
431
458
application/json :
432
459
schema :
433
- $ref : " #/components/schemas/ExtendedError"
460
+ oneOf :
461
+ - $ref : " #/components/schemas/StandardErrors"
462
+ - $ref : " #/components/schemas/ExtendedError"
434
463
HtmlResponse :
435
464
description : HTML page
436
465
content :
You can’t perform that action at this time.
0 commit comments