Browse Source

🐛 Add ValidationError schema even if only bodies

are declared in the defined endpoints
pull/11/head
Sebastián Ramírez 6 years ago
parent
commit
8c66b3a492
  1. 5
      fastapi/openapi/utils.py

5
fastapi/openapi/utils.py

@ -172,6 +172,11 @@ def get_openapi_path(
) )
if request_body_oai: if request_body_oai:
operation["requestBody"] = request_body_oai operation["requestBody"] = request_body_oai
if "ValidationError" not in definitions:
definitions["ValidationError"] = validation_error_definition
definitions[
"HTTPValidationError"
] = validation_error_response_definition
status_code = str(route.status_code) status_code = str(route.status_code)
response_schema = {"type": "string"} response_schema = {"type": "string"}
if lenient_issubclass(route.content_type, JSONResponse): if lenient_issubclass(route.content_type, JSONResponse):

Loading…
Cancel
Save