diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py index 271acd931..dc35124ee 100644 --- a/fastapi/openapi/utils.py +++ b/fastapi/openapi/utils.py @@ -347,7 +347,9 @@ def get_openapi_path( response_schema = {} route_responses = {str(k): v for k, v in route.responses.items()} - if status_code not in route_responses or not route_responses.get(status_code, {}).get('superimpose'): + if status_code not in route_responses or not route_responses.get( + status_code, {} + ).get("superimpose"): operation.setdefault("responses", {}).setdefault( status_code, {} ).setdefault("content", {}).setdefault(