counterfact icon indicating copy to clipboard operation
counterfact copied to clipboard

Add Support for Binary Data in Responses

Open dethell opened this issue 1 year ago • 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.

dethell avatar Apr 04 '24 10:04 dethell

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

pmcelhaney avatar Apr 04 '24 10:04 pmcelhaney