Hi there - I'm new to swaggerhub so noob question alert!
Can I use swaggerhub (app.swaggerhub.com) to test out apis hosted on my localhost? The CURL being generated by swaggerhub is perfect and works if I run it from git bash (I'm on windows). curl -X GET "http://localhost:57280/api/open" -H "accept: application/json".
However, when I click execute on swaggerhub it gives this error:
This leads me to believe that the URL is getting sent to swaggerhub's servers for resolution, and thus clearly localhost won't mean the same thing "over there". Or is swaggerhub editor/UI an SPA which emits the URL locally to my browser such that it _could_ resolve properly, but I'm just doing something wrong?
Full swagger ..
swagger: '2.0' info: version: '1.0' title: 'Basic features of azure b2c' description: 'Basic features of azure b2c' host : 'localhost:57280' basePath : '/api' paths: /open: # In this operation we do not apply the security, because it was applied globally above. # The security will be applied to this operation for that reason. get: summary: Server example operation description: This is an example operation to show how security is applied to the call. responses: 200: description: OK schemes: - http
"Try it out" requests are proxied through SwaggerHub servers in order to bypass CORSrestrictions in browsers. So, SwaggerHub needs the API server to be reachable over the public Internet. Localhost and local IPs are not supported as target servers.
To test against localhost, you can load your API definition into standalone Swagger UI, e.g.: