- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for set_dtype (0.08 sec)
-
tests/test_union_body_discriminator_annotated.py
from fastapi import Body from pydantic import Discriminator, Tag class Cat(BaseModel): pet_type: str = "cat" meows: int class Dog(BaseModel): pet_type: str = "dog" barks: float def get_pet_type(v): assert isinstance(v, dict) return v.get("pet_type", "") Pet = Annotated[ Union[Annotated[Cat, Tag("cat")], Annotated[Dog, Tag("dog")]],Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 7.7K bytes - Viewed (0)