It seems that the Swagger/OpenAPI does not have a clear way to achieve that. To be investigated. ## Server-Sent Events (SSE) - https://github.com/OAI/OpenAPI-Specification/issues/396 - https://github.com/whatwg/html/issues/2177 ### Links - [Server-sent events: a simple way to stream events from a server](https://jvns.ca/blog/2021/01/12/day-36--server-sent-events-are-cool--and-a-fun-bug/) - [Firebase - Streaming from the REST API](https://firebase.google.com/docs/reference/rest/database#section-streaming) - [Server-Sent Events](https://thisisvini.com/server-sent-events) ```sh curl -i -k -H "Accept: text/event-stream" http://playground.thisisvini.com/bohemian-rhapsody-event-stream ``` - [SO - How to use server-sent-events in express.js](https://stackoverflow.com/a/59041709/1123955) - [SO - Is using HTML5 Server-sent-events (SSE) ReSTful?](https://stackoverflow.com/a/32969809/1123955) - [YT: Two-minute video on how to create a streaming API](https://blog.axway.com/api-streaming/video-create-streaming-api-rest-api) - [YT: The end of polling: why and how to transform a REST API into a Data Streaming API? by Audrey Neveu](https://www.youtube.com/watch?v=NDDp7BiSad4) - [A better API for making Event Source requests, with all the features of fetch()](https://github.com/Azure/fetch-event-source) ## OpenAPI Callbacks - [OpenAPI 3.0 Callbacks](https://swagger.io/docs/specification/callbacks/) - [OpenAPI Callbacks and Webhooks](https://apisyouwonthate.com/blog/openapi-callbacks-and-webhooks) - https://github.com/OAI/OpenAPI-Specification/pull/2103 - [SO: How to define events in OpenAPI / Swagger spec?](https://stackoverflow.com/a/49725949/1123955) - [Mocking Callbacks with OpenAPI and Prism](https://blog.stoplight.io/mocking-callbacks-openapi-prism)
It seems that the Swagger/OpenAPI does not have a clear way to achieve that.
To be investigated.
Server-Sent Events (SSE)
Links
curl -i -k -H "Accept: text/event-stream" http://playground.thisisvini.com/bohemian-rhapsody-event-streamOpenAPI Callbacks