OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.36k stars 6.46k forks source link

[REQ] Generate TS fetch endpoints for EventStreams #17442

Open filiprejmus opened 9 months ago

filiprejmus commented 9 months ago

Is your feature request related to a problem? Please describe.

As far as I see it, the generator generates a simple GET fetch, even if the specified response in the spec looks like

responses:
        "200":
          description: Connection established for streaming updates.
          content:
            text/event-stream:
              schema: ...

Describe the solution you'd like

The Generator should generate a stream client endpoint that can be used like the spec in this MDN doc https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams

Describe alternatives you've considered

I can write own endpoints but that's kind of not the point of having everything generated

filiprejmus commented 9 months ago

If that's already implemented and my openapi.spec is wrong, or I'm missing some flag, let me know :)