I'm trying to define a file download endpoint using the OpenAPI spec (v3). I am facing two problems. 1) the file is not being downloaded 2) within swagger-ui, the response body shows a message that isn't produced by the server (i.e. can't parse JSON. Raw result:"
Anyone have a clue as to what I am doing wrong?
YAML code snapshot:
Output result from swagger-ui running on an AWS server.
The cause of the anomalous message, I was told, is because application/json is the content media said to be returned in the server's response header. See the header here:
The response is actually a text file -- not JSON. The sending server is incorrectly configured. Swagger-UI runtime response handler determines whether the response is valid. So Swagger-UI outputs the "can't parse JSON..." message.
Because of the error, the output to local storage function on the browser is not performed.
For more details, refer to the Swagger-UI issue #4098.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With