I am writing an OpenAPI 3.0 specification and have an endpoint returning a file. Now I found documentation on the website of Swagger but that's about a POST request: https://swagger.io/docs/specification/describing-request-body/multipart-requests/.
There's also another StackOverflow question with zero responses about my question, so I will give it another go.
How does one write a specification for a GET request where a file should be returned?
I currently have the following:
responses:
'200':
description: ok
content:
multipart/form-data:
schema:
type: object
description: The multipart object containing the file bytes
properties:
file:
type: string
format: binary
description: Bytes of the file
But I think this is mostly for POST request, to upload a file. Does anyone know what it should be?