- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for discriminator (0.04 sec)
-
tests/test_union_body_discriminator.py
class OtherItem(BaseModel): value: Literal["other"] price: float Item = Annotated[ Union[Annotated[FirstItem, Tag("first")], Annotated[OtherItem, Tag("other")]], Field(discriminator="value"), ] @app.post("/items/") def save_union_body_discriminator( item: Item, q: Annotated[str, Field(description="Query string")] ) -> dict[str, Any]: return {"item": item}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.1K bytes - Viewed (0) -
tests/test_union_body_discriminator_annotated.py
from inline_snapshot import snapshot from pydantic import BaseModel @pytest.fixture(name="client") def client_fixture() -> TestClient: 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):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 7.7K bytes - Viewed (0) -
docs/contribute/code_of_conduct.md
gender identity or expression, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected characteristics above, including participants with disabilities. Reporting Issues ----------------
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sun Feb 06 02:19:09 UTC 2022 - 5.1K bytes - Viewed (0)