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

Swagger Rails UI do not render example responses

Open vuthehuyht opened this issue 3 years ago • 0 comments

I want to add some examples of response to swagger to show it in the UI, but UI did not show it. I have checked swagger json file, examples of response had existed there and I tried to upload that json to SwaggerHub and it showed as I expected. I suggest, there are some problems when handling. Here my code: failure [ {code: 400, message: "Params invalid", model: Entities::V1::Error, examples: {"application/json" => {error_code: "400", message: "error message"}}}, {code: 401, message: "Unauthenticated", model: Entities::V1::Error, examples: {"application/json" => {error_code: "401", message: "error message"}}}, {code: 406, message: "Not Acceptable", model: Entities::V1::Error, examples: {"application/json" => {error_code: "406", message: "error message"}}} ]

vuthehuyht avatar Oct 08 '21 07:10 vuthehuyht