Skip to content

Commit

Permalink
Fix path param names
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Sep 9, 2021
1 parent 1760da0 commit 917e0a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastapi/utils.py
Expand Up @@ -31,7 +31,11 @@ def get_model_definitions(


def get_path_param_names(path: str) -> Set[str]:
return set(re.findall("{(.*?)}", path))
param_names = re.findall("{(.*?)}", path)
for i, name in enumerate(param_names):
if ":" in name:
param_names[i] = name[:name.index(":")]
return set(param_names)


def create_response_field(
Expand Down

0 comments on commit 917e0a9

Please sign in to comment.