Disable "server" dropdown menu?
See original GitHub issueQ&A (please complete the following information)
- OS: OSX
- Browser: Chrome
- Version: Varies by developer, generally latest
- Method of installation: NPM, via
swagger-ui-express@2.0.8
- Swagger-UI version: 3.1.4 (According to swagger-ui-express README)
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Swagger/OpenAPI definition:
servers:
- url: https://localhost:6021/api
Swagger-UI configuration options: No custom options specified. Using defaults.
Screenshots
How can we help?
We host the SwaggerUI with our API docs in the same app that provides the API. As part of that process, we programmatically modify the servers
property of the yaml file to contain the correct server name for that instance. (So, for example, you get localhost
with the proper port when working locally, the staging url when looking at staging, etc.) Because of this, there’s only ever one server in the definition when passed to SwaggerUI.
With this being the case, is there a way to disable the “server” dropdown in the swagger UI? With only one server ever available in the list, it seems to take up a lot of unnecessary space.
I suspect we’re just missing a simple configuration option, but I couldn’t find anything via the Power of Google. 😦
Thanks for any advice.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top GitHub Comments
I’d like to ask to reopen this one because the actual issues has not been solve. Making the CSS hack will visually hide the element, but not prevent from creating. I have the very same issue here. Our URL section:
is actually filitered on the fly by Spring WebMVC.
@michael-o it’s better to file a new issue because it was closed by the author. However, please read @hkosova’s comment as it provides a better solution overall.