You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Both HTTP and HTTPS ports cannot be specified #214
When I test the API with https://editor.swagger.io, I can switch the protocol from HTTP to HTTPS on the page, but because the port is entered only once with the host together and used for both schemes, I cannot actually send the request to the correct HTTPS endpoint:
while swagger assumes it's http there is also wss in there and soon there is server push and so on with http2.
Now there is no reason why somebody couldn't expose the swagger api over a rabbitmq messsage bus or some zeromq interface which supports these messaging paradigms.
the host can be assumed to be the same but a scheme represents more often than not a port.
I agree - I think it would be insanely cool (almost) if one could open up for using swagger to describe APIs exposed over other protocols than HTTP(s) - (I'm primarily thinking CoAP, MQTT, WebSockets)
Just out of curiosity, when you say you want to expose the APIs on both http and https, you intend to accept both secured and unsecured connections? I think it defeats the purpose of having security ... ?
Well, discussing security is out of the scope of this issue, isn't it? :-)
I can't know for what purpose is the API on the p[articular port used, how the connection is allowed the access to and how it is secured. All I deal with is that the server offers both schemes. I can either document and test both of them with Swagger, or I can use only one there.
I agree that unless more details are given, using https is a "must" for the usual REST API security.
+1
I want to serve some calls on http and other on https. I'm testing my API locally with swagger UI and as host I configured localhost:8080. When I select HTTPS, calls are still sent to 8080. I don't understand how this is supposed to be working. Would swagger UI switch back to default 80 443 if I omit port in host configuration?
Regards
Activity
webron commentedon Nov 20, 2014
That's a good point.
earth2marsh commentedon Mar 10, 2015
👍
mohsen1 commentedon Mar 10, 2015
My opinion:
We should make it possible to provide a list of hosts. Swagger should not be deterministic which host should be used for which scheme.
fehguy commentedon Mar 10, 2015
Is it unreasonable to expect that https is always 443?
webron commentedon Mar 10, 2015
Yes. The OP.
casualjim commentedon Mar 10, 2015
I'm all for scheme: port type of mapping
while swagger assumes it's http there is also wss in there and soon there is server push and so on with http2.
Now there is no reason why somebody couldn't expose the swagger api over a rabbitmq messsage bus or some zeromq interface which supports these messaging paradigms.
the host can be assumed to be the same but a scheme represents more often than not a port.
olensmar commentedon Mar 10, 2015
I agree - I think it would be insanely cool (almost) if one could open up for using swagger to describe APIs exposed over other protocols than HTTP(s) - (I'm primarily thinking CoAP, MQTT, WebSockets)
webron commentedon Mar 10, 2015
And pigeons.
fehguy commentedon Mar 10, 2015
@olensmar have you seen this project?
https://github.com/swagger-api/swagger-socket
Unbelievable potential with this.
ndhar-1 commentedon Jun 18, 2015
Just out of curiosity, when you say you want to expose the APIs on both http and https, you intend to accept both secured and unsecured connections? I think it defeats the purpose of having security ... ?
prantlf commentedon Jul 31, 2015
Well, discussing security is out of the scope of this issue, isn't it? :-)
I can't know for what purpose is the API on the p[articular port used, how the connection is allowed the access to and how it is secured. All I deal with is that the server offers both schemes. I can either document and test both of them with Swagger, or I can use only one there.
I agree that unless more details are given, using
httpsis a "must" for the usual REST API security.webron commentedon Mar 27, 2016
Parent: #560.
fmvilas commentedon May 16, 2017
@olensmar you might be interested in the AsyncAPI specification: asyncapi.com.
SergioArrighi commentedon Jul 3, 2017
+1
I want to serve some calls on http and other on https. I'm testing my API locally with swagger UI and as host I configured localhost:8080. When I select HTTPS, calls are still sent to 8080. I don't understand how this is supposed to be working. Would swagger UI switch back to default 80 443 if I omit port in host configuration?
Regards