pmcelhaney/counterfact

Add Support for Binary Data in Responses

dethell opened this issue · 1 comments

Per the OpenApi spec binary responses are allowed:

https://swagger.io/docs/specification/describing-responses/

v3 says to use "type": "string" but with "format": "binary".
v2 says to use just "type": "file"

Not sure how best to have an endpoint load and respond with binary data but perhaps if a mock had base64 data in a string the endpoint could then decode it before returning the response.

Yeah I think it could be either a Base64 encoded string or a Blob or a stream.