Spec Editor: 'Try it out' sends requests via http when swagger schema only supports https

Not applicable

My team is trying to verify our spec configuration using the ApiGee spec editor. Our issue happens when we try to hit an endpoint (via the 'Try it out' button on any endpoint) and get a failed response.

Our request fails because it is sent to to our system via the wrong protocol. Our system only supports requests via 'https', but ApiGee is sending our requests via 'http'. Below is an example of the url hit by ApiGee via the spec editor test, showing the http protocol:

curl -X GET http://api.ourapi.com/OurApi/V1/OurEndpoint/?Param1=123&Param2=abc -H  "accept: application/json" -H  "content-type: application/json"


My first guess was that we had an issue with our swagger configuration, particularly with the 'schemes' options. However, our swagger file appears to be configured correctly, with 'https' as the only available scheme. Here is a sample of our swagger spec, displaying the 'https' scheme:

{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "description": "Documentation and Test Harness",
    "title": "Our API"
  },
  "host": "api.ourapi.com",
  "basePath": "/OurApi/V1",
  "schemes": [ "https" ],
  "produces": [
    "application/json"
  ],  
"tags": [ ... ],
"paths": { ... }
}

Am I missing something in my configuration, or does the spec tester not support https requests? Thanks in advance for any help!
2 3 685
3 REPLIES 3

Not applicable

@kyleclark You are correct, looks like a bug.
the schemes element is not being considered right now and default is http.

cc @Marsh Gardiner @Floyd Jones

Note from @Maruti Chand: @kyleclark You are correct, looks like a bug.

the schemes element is not being considered right now and default is http.

Should this be raised with swagger and do we have any workaround available here?

Thanks,

Santosh