Not able to execute API from SwaggerHub
Hi,
I am new to SwaggerHub and having trouble accessing the API that I created using an existing swagger.yaml file on SwaggerHub.
I have specified the host name as my machine name (which is part of my office network and accessible via VPN) in the swagger.yaml
I am able to publish my API and when I go to 'Interactive API Doc' I see the endpoints listed as expected. However when I try any endpoint I get the following:
Response Body: getaddrinfo ENOTFOUND my_machine_name my_machine_name:port
Response Code: 500.
Following is the request URL:
I generated the swagger yaml file using swagger-maven-plugin and have annotated my endpoints with a @ApiOperation annotation.
Please let me know if I need to provide any more information.
Appreciate any help on this.
Thanks,
Deepti
Hi! SwaggerHub executes requests through a proxy on our server so we can deal with the challenges of CORS, etc. So the request actually does go through our server.
That means that if your server is inside your firewall (i.e. unreachable from the internet), you will _not_ be able to call it directly through SwaggerHub. We will be adding a feature to disable the proxy (or use a custom one) but that's not yet available.
Hi, you can certainly call your API if it's external. Just set the `host` and `basePath` fields and it will call those external services. Please post back with any questions!