Coverage for docs_src/cookie_param_models/tutorial002_an_py310.py: 100%
12 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-05-05 00:03 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-05-05 00:03 +0000
1from typing import Annotated 1abcd
3from fastapi import Cookie, FastAPI 1abcd
4from pydantic import BaseModel 1abcd
6app = FastAPI() 1abcd
9class Cookies(BaseModel): 1abcd
10 model_config = {"extra": "forbid"} 1abcd
12 session_id: str 1abcd
13 fatebook_tracker: str | None = None 1abcd
14 googall_tracker: str | None = None 1abcd
17@app.get("/items/") 1abcd
18async def read_items(cookies: Annotated[Cookies, Cookie()]): 1abcd
19 return cookies 1efghijkl