Issues with Swagger 'Try it out' because of 0.0.0.0 host #2837
Unanswered
nishantjain83
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
I am facing issues with the swagger-ui 'Try it out' button. The host configuration in the design.go contained the Host as "http://0.0.0.0/9090". As a result openapi.json also contains shows up host as "http://0.0.0.0/9090" and on trying the API, curl request is sent to "http://0.0.0.0/9090" for obvious reasons. Now the problem is that the API is hosted on a different server. On trying to hit the API from any other machine, the curl command fails.
I tried manually removing the Host from openapi.json and then things just work perfectly as the curl is sent to the same DNS which was used to open swagger-ui page.
Is there a way to disable writing "host" in openapi.json from design.go?
Beta Was this translation helpful? Give feedback.
All reactions