Use param.alias instead of param.name to cover both alias and name

This commit is contained in:
Pavel Knyazev 2022-12-08 19:49:55 +03:00
parent df62c9c1b1
commit 079f8ddcfa
1 changed files with 2 additions and 1 deletions

View File

@ -215,7 +215,8 @@ def preserve_path_params_order(dependant: Dependant) -> Callable[[ModelField], i
path_params_ordered.append(elem[1:-1])
def key(param: ModelField) -> int:
return path_params_ordered.index(param.name)
# Use param.alias to cover both alias and name
return path_params_ordered.index(param.alias)
return key