mirror of https://github.com/tiangolo/fastapi.git
simple condition
This commit is contained in:
parent
5bf577e563
commit
121fb20f26
|
|
@ -239,22 +239,13 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
|
||||||
typed_params = []
|
typed_params = []
|
||||||
|
|
||||||
for param in signature.parameters.values():
|
for param in signature.parameters.values():
|
||||||
if param.name in alias_dict:
|
param_name = param.name if param.name not in alias_dict else alias_dict[param.name]
|
||||||
original_param_name = alias_dict[param.name]
|
created_param = inspect.Parameter(
|
||||||
created_param = inspect.Parameter(
|
name=param_name,
|
||||||
name=original_param_name,
|
kind=param.kind,
|
||||||
kind=param.kind,
|
default=params.Param(**query_extra_info[param_name]),
|
||||||
default=params.Param(**query_extra_info[original_param_name]),
|
annotation=get_typed_annotation(param.annotation, globalns),
|
||||||
annotation=get_typed_annotation(param.annotation, globalns),
|
)
|
||||||
)
|
|
||||||
else:
|
|
||||||
created_param = inspect.Parameter(
|
|
||||||
name=param.name,
|
|
||||||
kind=param.kind,
|
|
||||||
default=params.Param(**query_extra_info[param.name]),
|
|
||||||
annotation=get_typed_annotation(param.annotation, globalns),
|
|
||||||
)
|
|
||||||
|
|
||||||
typed_params.append(created_param)
|
typed_params.append(created_param)
|
||||||
else:
|
else:
|
||||||
typed_params = [
|
typed_params = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue