mojotech / modernator-haskell

An API server for hosting Reddit AMA style Q&A sessions.
GNU General Public License v3.0
4 stars 0 forks source link

How do we specify websockets in Swagger? #3

Open RocketPuppy opened 8 years ago

RocketPuppy commented 8 years ago

Right now I've got this setup where a websocket request to /my/websocket/endpoint will get you a websocket, but a normal HTTP request will get you the last message sent. From an API perspective it's not perfect, but I like the idea. What this does allow is a specification of the HTTP functionality in Swagger, which includes models with their relevant schemas. That's the most important bit for working with the Websockets, but it would be nice to have that more specified. On the other hand, in this manner (and with some modifications to the HTTP functionality) we could potentially treat the Websocket functionality as an optimization detail, which would also be nice.