Is there a way to disable to try it out feature?
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?
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.