Forum Discussion
Swagger UI does not support WebSockets, and OpenAPI Specification is not really suitable for WebSocket APIs.
Check out AsyncAPI instead.
- fred335 years agoNew Contributor
Thank you Helen,
> Swagger UI does not support WebSockets
Ok, I understand and I will stop investigating this case.
> OpenAPI Specification is not really suitable for WebSocket APIs.
Well, it's perfectly suitable for some specific cases, like ours.
As a short example, imagine a database (tables: pet, store, user) that you can manage [control] and for which you would like to be notified [monitor] if something was Created/Updated/Deleted (like by another application for example) :
- OpenAPI enable to descritbe all resources + operations available from Client > Server (requests + responses) : this represent 100% of the "control" side need and potentially 98% of the doc.
- Notifications from Server > Client are very simple, and as they are generic for all tables, they require just 2% of the doc: for any table (pet, store, user), you can be notified that an item was Created/Updated/Modified.- Swagger UI would enable to test 100% of the controlling side, which is a great job.
- WebSocket has an interest for performance on high density servers (low bandwidth + fast notification) and to have notifications pass through NAT/Firewall.> AsyncAPI
Thanks for the info, but I have already explored this link from some previous posts on your site.
AsyncAPI may be great for "Event-Driven Architectures", but for the case reported above it looks like not appropriate (a huge solution for a light problem).
As Swagger is the creator of:
- SwaggerSockets (specifications for using REST over WebSockets)
- Open API specs (which define "ws" and "wss" schemes, the schemes for WebSocket))
- Swagger UI (which accepts "ws" and "wss" schemes for WebSocket)
this means that people at swagger spent time and energy on this subject (WebSockets + REST) and produced interesting specs and tools managing this.
I can understand that Swagger UI abandonned this support (which may be useful to not so many developers), but this would have been interesting to learn a little bit more from the company that created those specs and tools.
Anyway, thanks again Helen,
Best,
Related Content
- 3 years agoCeilingFan
- 2 years agoEmperor
Recent Discussions
- 3 days agoKF4UYC