- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for OtherRole (0.03 sec)
-
tests/test_schema_compat_pydantic_v2.py
from enum import Enum app = FastAPI() class PlatformRole(str, Enum): admin = "admin" user = "user" class OtherRole(str, Enum): ... class User(BaseModel): username: str role: PlatformRole | OtherRole @app.get("/users") async def get_user() -> User: return {"username": "alice", "role": "admin"} client = TestClient(app)Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 2.7K bytes - Viewed (0)