-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
http://localhost:3006/swagger-ui/index.html serves Swagger Petstore. Can this be disabled? #43
Comments
Hi, We rely on swagger-ui official webjars. We build our library on top of it. Also, you can rebuild the webjars for your own needs, if you don't want to have any reference to petsotre. |
I figured as much. I just wondered if there was a way to prevent it from being served or available. Sounds like there isn't. Bummer. |
Hi @leoherbie, we use the following workaround to prevent serving petstore:
|
Hi @StephGit I tried the way you have mentioned in the above comment, can you also post the contents of the method getHtmlContent |
Hi @anksngp Sure:
|
Hi @StephGit , @bnasslahsen When trying the above snippet I noticed that, the newly generated swagger document on calling just
Is there any way to get the properties applied to swagger document as well ? |
I'm using custom pathes for Swagger-UI and api-docs and to following application.yaml solved this issue for me (without using any of the above Workarounds):
Note the list of URLs under |
its not working for me, my configuration is as follows
and as a dependency I am using the below
|
I found this issue. Beware. Checking for ending with /index.html is not enough to disable petstore. You can get there with: /swagger-ui/index.html?configUrl= and a few other patterns I've found as well. |
To disable the swagger-ui default petstore url, just use the following property: springdoc.swagger-ui.disable-swagger-default-url=true More details, are available on the springdoc-openapi properties list: |
should be option available for replace default page instead |
It's also noteworthy that there is a difference between |
Navigating to http://localhost:3006/swagger-ui/index.html serves up the sample Swagger Petstore apis. Can these be disabled? I did not see any reference to the petstore within your codebase so perhaps this option does not exist just yet. Thanks so much.
Here is a stackoverflow that may be helpful:
https://stackoverflow.com/questions/49515713/remove-petstore-spec-when-starting-swagger-editor
The text was updated successfully, but these errors were encountered: