mirror of https://github.com/tiangolo/fastapi.git
Fix type hint
This commit is contained in:
parent
bc533c983d
commit
468c9d0dce
|
|
@ -193,7 +193,7 @@ def get_openapi_path(
|
|||
*, route: routing.APIRoute, model_name_map: Dict[type, str], operation_ids: Set[str]
|
||||
) -> Tuple[Dict[str, Any], Dict[str, Any], Dict[str, Any]]:
|
||||
path = {}
|
||||
empty_responses: List[int] = []
|
||||
empty_responses: List[str] = []
|
||||
security_schemes: Dict[str, Any] = {}
|
||||
definitions: Dict[str, Any] = {}
|
||||
assert route.methods is not None, "Methods must be a list"
|
||||
|
|
@ -308,7 +308,7 @@ def get_openapi_path(
|
|||
process_response, dict
|
||||
), "An additional response must be a dict"
|
||||
if not process_response and not process_rseponse_model:
|
||||
empty_responses.append(additional_status_code)
|
||||
empty_responses.append(str(additional_status_code))
|
||||
field = route.response_fields.get(additional_status_code)
|
||||
additional_field_schema: Optional[Dict[str, Any]] = None
|
||||
if field:
|
||||
|
|
@ -359,7 +359,7 @@ def get_openapi_path(
|
|||
deep_dict_update(operation, route.openapi_extra)
|
||||
if empty_responses:
|
||||
for response_status_code in empty_responses:
|
||||
del operation["responses"][str(response_status_code)]
|
||||
del operation["responses"][response_status_code]
|
||||
path[method.lower()] = operation
|
||||
return path, security_schemes, definitions
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue