Coverage for docs_src / response_model / tutorial002_py310.py: 100%
11 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
1from fastapi import FastAPI 1abgcdef
2from pydantic import BaseModel, EmailStr 1abgcdef
4app = FastAPI() 1abgcdef
7class UserIn(BaseModel): 1abgcdef
8 username: str 1abcdef
9 password: str 1abcdef
10 email: EmailStr 1abcdef
11 full_name: str | None = None 1abgcdef
14# Don't do this in production!
15@app.post("/user/") 1abgcdef
16async def create_user(user: UserIn) -> UserIn: 1abgcdef
17 return user 1hijk