Coverage for docs_src / path_params_numeric_validations / tutorial004_an_py310.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-04-06 01:24 +0000

1from typing import Annotated 1abcdefg

2 

3from fastapi import FastAPI, Path 1abcdefg

4 

5app = FastAPI() 1abcdefg

6 

7 

8@app.get("/items/{item_id}") 1abcdefg

9async def read_items( 1abcdefg

10 item_id: Annotated[int, Path(title="The ID of the item to get", ge=1)], q: str 

11): 

12 results = {"item_id": item_id} 1hklimjn

13 if q: 1hklimjn

14 results.update({"q": q}) 1hoij

15 return results 1hklimjn