I have a bunch of API endpoints that return text/csv
content in their responses. How do I document this? Here is what I currently have:
/my_endpoint:
get:
description: Returns CSV content
parameters:
- $ref: '#/components/parameters/myParemeters'
responses:
200:
headers:
$ref: '#/components/headers/myHeaders'
content: text/csv
As it stands, this does not work and I get the note in the Swagger preview:
Could not render this component, see the console.
The question is how do I properly display the content for csv responses? I find if does work if I do add a schema, something like this:
...
content:
text/csv:
schema:
type: array
items:
type: string
...
But there shouldn't be a schema since it is csv. So to go back to the question, what is the proper way to describe the csv response content?