|
@ -193,7 +193,7 @@ def get_openapi_path( |
|
|
*, route: routing.APIRoute, model_name_map: Dict[type, str], operation_ids: Set[str] |
|
|
*, route: routing.APIRoute, model_name_map: Dict[type, str], operation_ids: Set[str] |
|
|
) -> Tuple[Dict[str, Any], Dict[str, Any], Dict[str, Any]]: |
|
|
) -> Tuple[Dict[str, Any], Dict[str, Any], Dict[str, Any]]: |
|
|
path = {} |
|
|
path = {} |
|
|
empty_responses: List[int] = [] |
|
|
empty_responses: List[str] = [] |
|
|
security_schemes: Dict[str, Any] = {} |
|
|
security_schemes: Dict[str, Any] = {} |
|
|
definitions: Dict[str, Any] = {} |
|
|
definitions: Dict[str, Any] = {} |
|
|
assert route.methods is not None, "Methods must be a list" |
|
|
assert route.methods is not None, "Methods must be a list" |
|
@ -308,7 +308,7 @@ def get_openapi_path( |
|
|
process_response, dict |
|
|
process_response, dict |
|
|
), "An additional response must be a dict" |
|
|
), "An additional response must be a dict" |
|
|
if not process_response and not process_rseponse_model: |
|
|
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) |
|
|
field = route.response_fields.get(additional_status_code) |
|
|
additional_field_schema: Optional[Dict[str, Any]] = None |
|
|
additional_field_schema: Optional[Dict[str, Any]] = None |
|
|
if field: |
|
|
if field: |
|
@ -359,7 +359,7 @@ def get_openapi_path( |
|
|
deep_dict_update(operation, route.openapi_extra) |
|
|
deep_dict_update(operation, route.openapi_extra) |
|
|
if empty_responses: |
|
|
if empty_responses: |
|
|
for response_status_code in 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 |
|
|
path[method.lower()] = operation |
|
|
return path, security_schemes, definitions |
|
|
return path, security_schemes, definitions |
|
|
|
|
|
|
|
|