Skip to content

Generate a per-endpoint SSE adapter mapping events to typed models #62

Description

@OmarAlJarrah

Problem

Streaming endpoints need to map raw SSE events to typed models with endpoint-specific conventions.

Proposed change

Generate a per-endpoint SSE adapter turning SseStream<ServerSentEvent> into Iterable<TModel>, with a configurable done-sentinel and error-envelope→exception mapping. Keep the sentinel/error conventions out of core (they're per-API). Decode each element lazily on consume via the Serde SPI.

Acceptance

  • Per-endpoint SSE→model adapter
  • Lazy per-element decode
  • Test

Builds on the AutoCloseable SSE stream + ResponseHandler seam.

Dependencies


Priority: medium · Effort: medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegenfuture KotlinPoet codegenenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions