mirror of https://github.com/tiangolo/fastapi.git
Fix test - use default value instead of `default_factory`
This commit is contained in:
parent
4c68df1804
commit
fb17bbd074
|
|
@ -48,7 +48,10 @@ def form_model(params: Annotated[FormParams, Form()]):
|
|||
|
||||
@app.post("/form-param-list-with-default")
|
||||
def form_param_list_with_default(
|
||||
params: Annotated[List[str], Form(default_factory=list)],
|
||||
params: Annotated[
|
||||
List[str],
|
||||
Form(),
|
||||
] = [], # noqa: B006 (default_factory doesn't work with Pydantic V1)
|
||||
):
|
||||
return {"params": params}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue