twskj/pretty-swag

'Try it out' API calls using HTTP, not HTTPS

JeremyCraigMartinez opened this issue · 6 comments

The requests against the API for trying out an endpoint is not reading from schemes in the swagger.json. I'm getting a GET against an http:// even though my swagger definition is

{
  "swagger": "2.0",
  "info": {
    "version": "2019-03-04T21:51:15Z",
    "title": "API"
  },
  "host": "api.my-domain.com",
  "schemes": [
    "https"
  ],
...
twskj commented

Thanks for reporting :)
I'll have a look in the evening.

Awesome, thanks! I also noticed the same issue with the pet store docs

This is a Mixed Content call. Many browsers will block this by default.

twskj commented

That generally means that when the document is served under https but trying to make an ajax call out to http endpoint usually get blocked by default. It's an expected behavior in Chrome and Firefox as far as I know

twskj commented

It's a bug having only https should not show http option. I'll make some adjustment for this.

twskj commented

I rolled out the fix in 0.2.3.
Now it should respect scheme from the input and show only what available.
Check it out

twskj commented

I am closing this. If you still have problem, feel free to reopen.