Skip to content

Removing option "try it out" #749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lochetti opened this issue Nov 26, 2014 · 7 comments
Closed

Removing option "try it out" #749

lochetti opened this issue Nov 26, 2014 · 7 comments

Comments

@lochetti
Copy link

Is there a way to remove the option to try the api in some APIs? (Not all of them)

@webron
Copy link
Contributor

webron commented Nov 26, 2014

There's a long, long, long discussion on it in issue #156.

@fehguy
Copy link
Contributor

fehguy commented Nov 26, 2014

Yes, right now, you can only disable all try it now functionality, not partial. You'll have to fork the library to do what you're after.

@fehguy fehguy closed this as completed Nov 27, 2014
@tokra
Copy link

tokra commented Dec 10, 2014

Has anyone find out ?

@webron
Copy link
Contributor

webron commented Dec 10, 2014

find out what?

@bssarath
Copy link

Did you try passing an empty array to the "supportedSubmitMethods" parameter while creating the Swagger UI object. As per the documentation https://github.com/swagger-api/swagger-ui#parameters
"An array of of the HTTP operations that will have the 'Try it out!' option. An empty array disables all operations. This does not filter the operations from the display."

@tokra
Copy link

tokra commented Mar 14, 2017

@webron find out how to disable it.. I did find out but after a while..

@paparthi
Copy link

Got it working for me in SpringFox 2.7.0.
Ref https://g00glen00b.be/documenting-rest-api-swagger-springfox/
And, create a bean like this:

@Bean
public UiConfiguration uiConfig() {
    String[] supportedMethods = {};
    return new UiConfiguration(null, supportedMethods);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants