swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.38k stars 8.92k forks source link

Support for WebSockets (ws/wss) #5220

Open wzshiming opened 5 years ago

wzshiming commented 5 years ago

any protocol (such as ws/wss) scheme can be specified in the servers/url property.

shockey commented 5 years ago

@wzshiming, what protocol(s) are you seeking support for?

Generally, we're pretty limited in what we can offer in Swagger UI because of restrictions in browser support, as well as the Fetch/XmlHttpRequest standards.

wzshiming commented 5 years ago

Such as the WebSocket (ws/wss)

shockey commented 5 years ago

I've catalogued this as a feature request!

I'm not sure when/if we'll support this, since (1) Swagger UI is largely designed around a 1:1 request/response flow, and (2) window.fetch, which we use for network requests, doesn't support ws/wss.

nithinbandaru1 commented 1 year ago

@wzshiming @shockey

According to this URL https://swagger.io/docs/specification/api-host-and-base-path/ it is mentioned that ws and wss can be specified in URL scheme.

So, I assume web sockets can be represented using swagger UI. I think we can use same paths region to specify what will be request and what will be response. Only thing I need to specify is direction if request is from server or from client.

Is there any example for this??

pyrofolium commented 11 months ago

yeah mentioned and no examples last I looked. I'm going to assume it's not supported.