The Wire · Showcase
FASTAPI FIXES STREAMING SCHEMA CHAOS ACROSS 4 CRITICAL BUGS
By RepoJournal · Filed · About FastAPI & Pydantic
FastAPI shipped fixes for four streaming and schema generation bugs that were silently breaking OpenAPI contracts and response validation across SSE, JSONL, and typed iterables.
The most urgent: SSE and JSONL streaming endpoints were ignoring declared `status_code` parameters and `Response` modifications, always returning 200 while OpenAPI documented whatever you declared [1]. That's a contract violation that will break client code expecting a different status. Equally critical, when those same streaming routes went through `include_router()`, the schema lost all stream item type information, turning `itemSchema` into an empty object [2]. Runtime behavior stayed correct, but any client relying on the OpenAPI spec to understand what they were receiving got nothing. Beyond streaming, two more bugs hit non-streaming routes: nested `Annotated` types in sequences were crashing at startup [3], and non-generator endpoints annotated with `Iterable[T]` were dropping all `response_model_*` serialization options like `exclude_unset` and `exclude_defaults` [4]. This period saw 17 commits and 6 releases across the repo, but these four fixes are what matter.
One email a day. Unsubscribe in one click.
Keep up with FastAPI & Pydantic in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade FastAPI if you use SSE or JSONL streaming endpoints - status codes are now honored fastapi/fastapi [immediate]
- → Regenerate OpenAPI specs for routed streaming endpoints to pick up corrected item schemas fastapi/fastapi [plan]
- → If using nested Annotated types with Query() or Body(), upgrade to unblock startup fastapi/fastapi [immediate]
- → Audit any Iterable[T] endpoints using response_model_exclude_* for missing serialization fastapi/fastapi [plan]
References
- [1] 🐛 Fix `status_code` being ignored for SSE and JSONL streaming endpoints ↗ fastapi/fastapi
- [2] 🐛 Fix stream item type lost when using `include_router()` ↗ fastapi/fastapi
- [3] 🐛 Fix handling sequences with nested Annotated types ↗ fastapi/fastapi
- [4] 🐛 Fix `response_model_*` params ignored for non-generator endpoints with `Iterable[..]` return type ↗ fastapi/fastapi