Is there support for x-codeSamples #8946
Unanswered
marcodelmoral
asked this question in
Questions
Replies: 2 comments
-
It is possible to add code samples:
For my case, I have an
And then I add these all to the doc with the following:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Use the openapi_extra parameter import fastapi
app = fastapi.FastAPI()
@app.post(
"/test",
openapi_extra={"x-codeSamples": [{"lang": "Python", "source": "print('FastAPI!')", "label": "Python"}]}
)
async def test():
pass |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
ReDoc supports some extra function, including code samples. Is there any way to implement this within fastapi?
Beta Was this translation helpful? Give feedback.
All reactions