Rswag: Try it out

Created on 26 Jun 2017  路  4Comments  路  Source: rswag/rswag

Is there a way to disable to try it out feature?

Most helpful comment

An even simpler solution to this problem is simply editing one line in the index.html.rb file, namely this one: (should be somewhere around line 45-50)
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],

In this line you list the methods for which you want to have 'Try it' enabled. Thus, in order to disable 'Try it' at all, just change the line to:

supportedSubmitMethods: [],

or simply remove it.

All 4 comments

Take a look at the Swagger UI project, specifically version 2.x as that's what rswag currently uses to drive the UI. It has an option called __supportedSubmitMethods__ which is exactly what you're looking for.

The downside is in order to actually set that value, you'll need to provide your own customized version of the swagger-ui index.html page (see https://github.com/domaindrivendev/rswag#customizing-the-swagger-ui).

Suggestion worked.

An even simpler solution to this problem is simply editing one line in the index.html.rb file, namely this one: (should be somewhere around line 45-50)
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],

In this line you list the methods for which you want to have 'Try it' enabled. Thus, in order to disable 'Try it' at all, just change the line to:

supportedSubmitMethods: [],

or simply remove it.

Is there any way to try post methods without creating a record in the database?
Or should we just disable the try it out on post methods?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilippeChab picture PhilippeChab  路  4Comments

martio picture martio  路  4Comments

nicwillemse picture nicwillemse  路  4Comments

DalfDev picture DalfDev  路  3Comments

martio picture martio  路  5Comments