Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Describe websocket api via Swagger

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?

like image 230
Somebody Avatar asked Jul 04 '16 13:07

Somebody


People also ask

What is the WebSocket API?

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.

How do I make a WebSocket API?

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.


2 Answers

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.

like image 199
Benjamin Soulier Avatar answered Sep 24 '22 17:09

Benjamin Soulier


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.

like image 42
Nikhil VJ Avatar answered Sep 23 '22 17:09

Nikhil VJ