Skip to content

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

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

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

codspeed Bot commented Apr 28, 2026

Copy link
Copy Markdown

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)

@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Jun 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

@YuriiMotov YuriiMotov closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict

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