grape-swagger icon indicating copy to clipboard operation
grape-swagger copied to clipboard

Swagger response format yaml

Open dieuit07 opened this issue 6 years ago • 3 comments

Hi everyone, I would like to change the response type from JSON to yaml. I try config produces: ['application/yaml'] but seem not affected. I could respond yaml syntax, but the error return still is JSON. How could I change the error message to YAML?

dieuit07 avatar Jul 30 '19 08:07 dieuit07

It seems, that there is no offical mime type for yaml … atm, but your first version, where the output was included, looked not bad.

So recommend to let it expose as it is and set the mine type to text.

Question is, how it will be handled?

LeFnord avatar Jul 31 '19 10:07 LeFnord

So that I need the way to catch the error response to convert it to YAML too. Also for the http_codes description. Do you know which way to do that?

dieuit07 avatar Jul 31 '19 11:07 dieuit07

Any news on how it can be done? Having yaml /api/swagger_doc file instaed of json?

newstler avatar Apr 07 '22 21:04 newstler