Is it possible to describe Websocket server api via Swagger?
We have events broadcasting via websocket server and i want to describe them via one swagger specification file.
Is there any documentation generators for websockets?
The WebSocket API invokes your backend based on the content of the messages it receives from client apps. Unlike a REST API, which receives and responds to requests, a WebSocket API supports two-way communication between client apps and your backend. The backend can send callback messages to connected clients.
To create a WebSocket API using the API Gateway consoleSign in to the API Gateway console and choose Create API. Under WebSocket API, choose Build. Under Settings, in the API name field, enter the name of your API, for example, PetStore . Enter a Route Selection Expression for your API, for example, $request.
It seems to be possible using swagger-socket.
Still, it seems that only a Java/Scala server implementation exists for now, which means they are not as much codegens for this that there is for "standard" Swagger REST services.
Edit: As pointed out, this project seems to be dead. Unfortunately at the time of updating this answer, it does not seem that Swagger is a good tooling for type web-socket messages.
Not a documentation generator but this does do documentation of sockets
Firecamp - https://firecamp.io/ is like Postman but also does websocket and socketio connections. So you can document the socket connection there and export it in a collection same as we would with APIs in Postman.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With