Coverage for docs_src / query_params / tutorial003_py310.py: 100%
10 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
1from fastapi import FastAPI 1def
3app = FastAPI() 1def
6@app.get("/items/{item_id}") 1def
7async def read_item(item_id: str, q: str | None = None, short: bool = False): 1def
8 item = {"item_id": item_id} 1abc
9 if q: 1abc
10 item.update({"q": q}) 1abc
11 if not short: 1abc
12 item.update( 1abc
13 {"description": "This is an amazing item that has a long description"}
14 )
15 return item 1abc