Skip to content

fix(routing): preserve SSE stream_item_type through include_router#15445

Open
onthebed wants to merge 2 commits into
fastapi:masterfrom
onthebed:clawoss/fix/15401-stream-item-type
Open

fix(routing): preserve SSE stream_item_type through include_router#15445
onthebed wants to merge 2 commits into
fastapi:masterfrom
onthebed:clawoss/fix/15401-stream-item-type

Conversation

@onthebed
Copy link
Copy Markdown

include_router recreates SSE routes with response_model=None, so the merged route drops stream_item_type and loses the item schema.

Copied the streaming metadata onto the recreated route and rebuilt its handler so OpenAPI and runtime serialization keep seeing the field.

Added a regression test for an included SSE route that checks the merged route metadata and OpenAPI schema.

Fixes #15401

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 28, 2026

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing onthebed:clawoss/fix/15401-stream-item-type (41f5f96) with master (1f7c8c1)1

Open in CodSpeed

Footnotes

  1. No successful run was found on master (4f64b8f) during the generation of this report, so 1f7c8c1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@YuriiMotov
Copy link
Copy Markdown
Member

This is basically the same approach as in #15426
See my comment to that PR: #15426 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSE stream_item_type not propagated through APIRouter + include_router

2 participants