3.9 union

This commit is contained in:
JONEMI21 2026-01-28 12:51:25 +00:00
parent ef3c5fa1f1
commit 07ceed403d
1 changed files with 2 additions and 2 deletions

View File

@ -155,12 +155,12 @@ def test_required_dict_union(path: str):
@app.get("/required-dict-of-union")
async def read_required_dict_of_union(p: Annotated[dict[str, int | bool], Query()]):
async def read_required_dict_of_union(p: Annotated[dict[str, Union[int, bool]], Query()]):
return {"p": p}
class QueryModelRequiredDictOfUnion(BaseModel):
p: dict[str, int | bool]
p: dict[str, Union[int, bool]]
@app.get("/model-required-dict-of-union")