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-01-13 13:38 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-01-13 13:38 +0000
1from typing import Annotated 1abc
3from fastapi import Cookie, FastAPI 1abc
4from pydantic import BaseModel 1abc
6app = FastAPI() 1abc
9class Cookies(BaseModel): 1abc
10 model_config = {"extra": "forbid"} 1abc
12 session_id: str 1abc
13 fatebook_tracker: str | None = None 1abc
14 googall_tracker: str | None = None 1abc
17@app.get("/items/") 1abc
18async def read_items(cookies: Annotated[Cookies, Cookie()]): 1abc
19 return cookies 1defghi