How to return a file from an endpoint? #236
Replies: 1 comment
-
I tried something like this and it seems to present well to users: @api.get(
"/screenshot",
responses={
HTTPStatus.OK: {"content": {"image/png": {"schema": {"type": "string", "format": "binary"}}}}
},
summary="Get screenshot.",
) |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
One of the endpoints of my API should return a binary file.
Do you have any example showing how to represent this with flask-openapi3?
The
responses
field only accept dict or pydantic models.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions