Browse Source

Fix variable names and remove a redundant assignment

pull/5075/head
svd0 3 years ago
parent
commit
57c9d0bcd1
  1. 7
      fastapi/utils.py

7
fastapi/utils.py

@ -137,11 +137,10 @@ def generate_operation_id_for_path(
def generate_unique_id(route: "APIRoute") -> str: def generate_unique_id(route: "APIRoute") -> str:
operation_id = route.name + route.path_format route_path_name = route.name + route.path_format
operation_id = re.sub("[^0-9a-zA-Z_]", "_", operation_id) operation_id = re.sub("[^0-9a-zA-Z_]", "_", route_path_name)
assert route.methods assert route.methods
operation_id = f"{operation_id}_{list(route.methods)[0].lower()}" return f"{operation_id}_{list(route.methods)[0].lower()}"
return operation_id
def deep_dict_update(main_dict: Dict[Any, Any], update_dict: Dict[Any, Any]) -> None: def deep_dict_update(main_dict: Dict[Any, Any], update_dict: Dict[Any, Any]) -> None:

Loading…
Cancel
Save