MCPcopy
hub / github.com/fastapi/fastapi / path_examples

Function path_examples

tests/test_openapi_examples.py:35–53  ·  view source on GitHub ↗
(
    item_id: str = Path(
        examples=[
            "json_schema_item_1",
            "json_schema_item_2",
        ],
        openapi_examples={
            "Path One": {
                "summary": "Path One Summary",
                "description": "Path One Description",
                "value": "item_1",
            },
            "Path Two": {
                "value": "item_2",
            },
        },
    ),
)

Source from the content-addressed store, hash-verified

33
34@app.get("/path_examples/{item_id}")
35def path_examples(
36 item_id: str = Path(
37 examples=[
38 "json_schema_item_1",
39 "json_schema_item_2",
40 ],
41 openapi_examples={
42 "Path One": {
43 "summary": "Path One Summary",
44 "description": "Path One Description",
45 "value": "item_1",
46 },
47 "Path Two": {
48 "value": "item_2",
49 },
50 },
51 ),
52):
53 return item_id
54
55
56@app.get("/query_examples/")

Callers

nothing calls this directly

Calls 1

PathClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…