Fix test - use default value instead of `default_factory`

This commit is contained in:
Yurii Motov 2025-11-02 15:33:14 +01:00
parent 4c68df1804
commit fb17bbd074
1 changed files with 4 additions and 1 deletions

View File

@ -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}