-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Configure swagger-ui-dist URL server side #5710
Comments
Another alternative is to store the configuration in a separate file, e.g. |
You could also redirect to the ?url= query paramenter:
|
Yes but they are all workarounds... |
@deusama |
Here is my solution for anyone wondering : Create your own swagger-initializer.js file with the correct API descriptor and replace the script in the swagger index.html file :
|
or
|
Is your feature request related to a problem?
This issue is related to the #4624 and the
swagger-ui-dist
library. There is no way to change the url on the server side without modifying the node_module folders or without having an endpoint that accept requests for theindex.html
and that serves the modified index. Both this solution are not acceptable, in fact for the first one it's clearly a bad practice to change the node_modules folder content on runtime and for the second I cannot replace an example URL that I have no certainty it will be constant in each update.Describe the solution you'd like
I do not know a clear solution for this problem. Maybe the only way is indeed to modify the content of the index.html but at least I was expecting that there will be a function to do that inside the library. Maybe this is the simplest solution.
Describe alternatives you've considered
https://petstore.swagger.io/v2/swagger.json
with my JSON swagger configuration endpoint.The text was updated successfully, but these errors were encountered: