Responder 9.2 makes typed SSE and NDJSON complete incremental response contracts, from per-item runtime validation through OpenAPI and generated streaming clients.
Highlights
@api.sseand@api.ndjsoninfer item contracts from sync or async iterator return annotations, with explicit model overrides when needed.- Every yielded item is validated and serialized with Pydantic while preserving backpressure, cancellation cleanup, SSE heartbeats, and
Last-Event-ID. responder.SSE[T]provides typed data and standard SSE metadata.- OpenAPI describes stream media types and item schemas, and generated Python, JavaScript, TypeScript, Ruby, and PHP clients consume streams lazily.
- Immediately available first-item contract failures return HTTP 500 before headers are sent; later failures are logged and terminate the stream without emitting invalid data.