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

Function examples

tests/test_openapi_examples.py:14–31  ·  view source on GitHub ↗
(
    item: Item = Body(
        examples=[
            {"data": "Data in Body examples, example1"},
        ],
        openapi_examples={
            "Example One": {
                "summary": "Example One Summary",
                "description": "Example One Description",
                "value": {"data": "Data in Body examples, example1"},
            },
            "Example Two": {
                "value": {"data": "Data in Body examples, example2"},
            },
        },
    ),
)

Source from the content-addressed store, hash-verified

12
13@app.post("/examples/")
14def examples(
15 item: Item = Body(
16 examples=[
17 {"data": "Data in Body examples, example1"},
18 ],
19 openapi_examples={
20 "Example One": {
21 "summary": "Example One Summary",
22 "description": "Example One Description",
23 "value": {"data": "Data in Body examples, example1"},
24 },
25 "Example Two": {
26 "value": {"data": "Data in Body examples, example2"},
27 },
28 },
29 ),
30):
31 return item
32
33
34@app.get("/path_examples/{item_id}")

Callers

nothing calls this directly

Calls 1

BodyClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…