Configure swagger-ui-dist URL server side
See original GitHub issueIs 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 the index.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
- [ ] Save index.html content and serve it to the index.html endpoint (not so usable without Express or similar)
- On application startup replace
https://petstore.swagger.io/v2/swagger.json
with my JSON swagger configuration endpoint.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:6 (1 by maintainers)
Top GitHub Comments
@deusama That was my workaround but it stopped working with version 4.1.3. Reading the url as a query parameter is blocked now.
or