acacode / acacode/swagger-typescript-api

Support generating EventSource clients for text/event-stream endpoints

Open
#1,819 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.1k
Forks
436
PR merge metrics
No merged PRs in 30d

Description

OpenAPI explicitly supports text/event-stream as a response media type (See https://spec.openapis.org/oas/latest.html#media-types). Currently swagger-typescript-api generates these endpoints as a standard request(), where T is the schema of a single event payload. However, this is semantically incorrect because an SSE endpoint produces a sequence of events rather than a single response object.

Would you be interested in adding optional support for generating SSE-aware clients (for example returning EventSource, AsyncIterable, or via a configurable template) when the response media type is `text/event-stream`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.