Coverage for docs_src / cookie_param_models / tutorial002_an_py310.py: 100%
12 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 typing import Annotated 1abefcd
3from fastapi import Cookie, FastAPI 1abefcd
4from pydantic import BaseModel 1abefcd
6app = FastAPI() 1abefcd
9class Cookies(BaseModel): 1abefcd
10 model_config = {"extra": "forbid"} 1abefcd
12 session_id: str 1abcd
13 fatebook_tracker: str | None = None 1abefcd
14 googall_tracker: str | None = None 1abefcd
17@app.get("/items/") 1abefcd
18async def read_items(cookies: Annotated[Cookies, Cookie()]): 1abefcd
19 return cookies 1ghijklm