mirror of https://github.com/tiangolo/fastapi.git
Use param.alias instead of param.name to cover both alias and name
This commit is contained in:
parent
df62c9c1b1
commit
079f8ddcfa
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue