Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have installed Swagger UI on my local machine. When I am pulling up some Swagger definitions, the definitions are working fine, however, when I click on the "Try it out!" button, the call fails stating "No response from server" .

However, when I take the Request URL from Swagger UI and run it directly in the browser, the server responds (BAU).

Am I missing something? Do I need to setup/configure Swagger UI to make this call happen?

Note: I have just downloaded the latest version of Swagger and running it locally on Windows desktop with Tomcat server.

Please help.

The specs for Swagger-ui is usually in JSON format which contains host(including port), basePath, paths (path array of each API service). Swagger-client will construct the request URL from all these properties and send the request to the URL with an "Accept" header. Now you can not get response from service you need to check whether the backend services are running. You can open browser development tools to capture the HTTP request and see if it is correct.

You can go to http://petstore.swagger.io/ to see how it works.

Although not entirely related to OP's question, my problem was that the response wasn't appearing on the page .

Adding the missing responses setting to each respective HTTP method solved the issue .

"paths": {
  "/path": {
    "get": {
      "description": ...,
      "parameters": [ ... ],
      "responses": {}

Also, a reminder: it's possible to inspect the request in the developer tools network tab in the browser to read response headers and body.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.