MCPcopy Index your code
hub / github.com/fastapi/fastapi / read_items

Function read_items

docs_src/query_params_str_validations/tutorial008_py310.py:7–18  ·  view source on GitHub ↗
(
    q: str | None = Query(
        default=None,
        title="Query string",
        description="Query string for the items to search in the database that have a good match",
        min_length=3,
    ),
)

Source from the content-addressed store, hash-verified

5
6@app.get("/items/")
7async def read_items(
8 q: str | None = Query(
9 default=None,
10 title="Query string",
11 description="Query string for the items to search in the database that have a good match",
12 min_length=3,
13 ),
14):
15 results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
16 if q:
17 results.update({"q": q})
18 return results

Callers

nothing calls this directly

Calls 1

QueryClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…