MCPcopy
hub / github.com/fastapi/fastapi / read_items

Function read_items

docs_src/path_params_numeric_validations/tutorial006_py310.py:7–18  ·  view source on GitHub ↗
(
    *,
    item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
    q: str,
    size: float = Query(gt=0, lt=10.5),
)

Source from the content-addressed store, hash-verified

5
6@app.get("/items/{item_id}")
7async def read_items(
8 *,
9 item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
10 q: str,
11 size: float = Query(gt=0, lt=10.5),
12):
13 results = {"item_id": item_id}
14 if q:
15 results.update({"q": q})
16 if size:
17 results.update({"size": size})
18 return results

Callers

nothing calls this directly

Calls 2

PathClass · 0.90
QueryClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…