-
Notifications
You must be signed in to change notification settings - Fork 760
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
overriding host #1045
Comments
this worked for me but it's not official nor elegant https://gist.github.com/hareeqi/c9496288cfccf52342930874ac9670d3 |
This is actually very important for many scenarios, simplest being one spec and executing against test systems. How to achieve the same without the ability to switch? I can only think of multiple specs, one for each target system. In case only the host differs this does not make much sense. Hence, this feature should be considered important. |
It is considered important, but we still have to prioritize based on our resources. As with anything else, PRs are welcome. @zhimoda in general, if you don't specify a host at all, and load it from the environment that you want to run against, that would work as well. |
Wanted to comment here with a semi-workaround. For me, I wanted to showcase a production URL in the docs, but have the "Try it out" button fire requests to a staging URL instead. I'm sure I'm not alone in this desire. What I did was just set the host in my Swagger conf file to my staging URL so that the "Try it out" button would use that, but I just changed the
|
Please consider include ability to override |
+1 |
1 similar comment
+1 |
Folks, please note that OpenAPI 3.0 allows you to specify multiple URLs for your API, and use variables in server hostnames and paths. Support for this is in Swagger-UI 😄 |
@AdrieanKhisbe, we don't have a gitter (swagger-api/swagger-ui#3544!), send me an email if you need guidance! |
Any updates on the ability to override the Host? |
I need this feature too |
I need this feature too. |
@cancan101, |
2 years and still no way to override host at init ? |
I'm also looking for this. Sounds like easily solvable inside the app. |
I've explained here why there is no need for Addressing this issue should now be possible purely from Closing in favor of swagger-api/swagger-ui#5981 |
In the old version of UI, i can override the host using window.swaggerUi.api.setHost(url), as explained in #532.
How could achieve the same with the latest version?
The text was updated successfully, but these errors were encountered: