Created
January 18, 2023 09:43
-
-
Save ehvattum/e7fdc53bda8a3d03556c0c649cdef7c9 to your computer and use it in GitHub Desktop.
Openapi multiple content-types responses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi":"3.0.2", | |
"info": { | |
"title":"Multi content-type generator spec", | |
"version":"1.0" | |
}, | |
"servers": [ | |
{"url":"https://api.server.test/v1"} | |
], | |
"paths": { | |
"/pdf-or-json": { | |
"get": { | |
"summary": "Return a .pdf, or a json error", | |
"operationId": "getPdfOrJson", | |
"parameters": [], | |
"responses": { | |
"200": { | |
"description": "OK", | |
"content": { | |
"application/pdf": { | |
"schema": { | |
"type": "string", | |
"format": "binary" | |
} | |
} | |
}, | |
"headers": {} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"error-message": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment