ruby-grape / grape-swagger

Add OAPI/swagger v2.0 compliant documentation to your grape API
MIT License
1.09k stars 470 forks source link

Swagger response format yaml #754

Open dieuit07 opened 5 years ago

dieuit07 commented 5 years ago

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?

LeFnord commented 5 years ago

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?

dieuit07 commented 5 years ago

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?

newstler commented 2 years ago

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