Claude
56cce71282
📝 Add documentation section for typed ServerSentEvent[Data]
The previous commit added ServerSentEvent[Data] generic support and
tutorial006 but did not add a corresponding section to the SSE docs.
This adds the missing "Typed ServerSentEvent" section explaining the
generic syntax, validation behavior, and OpenAPI contentSchema benefit.
https://claude.ai/code/session_01GRv2sCmACvBQFX7fh7anWm
3 months ago
Ben Mosher
e9212d8483
✨ Make ServerSentEvent generic with typed data field
Introduce `ServerSentEvent[Data]` so endpoints that yield typed SSE
events get a `contentSchema` in the OpenAPI spec reflecting the data
payload type, while retaining full control over SSE fields (`event`,
`id`, `retry`, `comment`).
- `ServerSentEvent` now inherits from `Generic[Data]` with `data: Data`
- `validate_default=True` ensures `ServerSentEvent[Item]()` raises a
ValidationError (data is effectively required when Data is concrete)
- `ServerSentEvent[Item | None]` allows optional data; bare
`ServerSentEvent` is fully backward compatible (`Data=Any`)
- Added `get_sse_data_type()` helper (uses Pydantic's
`__pydantic_generic_metadata__`) to extract `Data` from a
parameterized `ServerSentEvent[Data]` annotation
- Routing layer now extracts `Data` from `ServerSentEvent[Data]` and
uses it as `stream_item_type`, feeding it into the existing OpenAPI
`contentSchema` pipeline
- Added tutorial006 and corresponding snapshot test
- Extended test_sse.py with generic SSE unit and app-level tests
Co-Authored-By: Claude Sonnet 4.6 <[email protected] >
3 months ago
github-actions[bot]
64feaec802
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
12bbd9453f
🌐 Update translations for zh (update-outdated) ( #15177 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
453988f359
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
fe98ea307a
🌐 Update translations for zh-hant (update-outdated) ( #15178 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
b7bd1874fe
📝 Update release notes
[skip ci]
3 months ago
dependabot[bot]
602ddc2e51
⬆ Bump authlib from 1.6.7 to 1.6.9 ( #15128 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <[email protected] >
3 months ago
github-actions[bot]
30bd2d5878
📝 Update release notes
[skip ci]
3 months ago
github-actions[bot]
a4e005c140
📝 Update release notes
[skip ci]
3 months ago
dependabot[bot]
6cd66ace1c
⬆ Bump pyasn1 from 0.6.2 to 0.6.3 ( #15143 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 months ago
dependabot[bot]
2fba244c3a
⬆ Bump ujson from 5.11.0 to 5.12.0 ( #15150 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
6cd1a2c75d
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
df4417efa5
🌐 Update translations for zh-hant (add-missing) ( #15176 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
1122d37676
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
5ef5490bc4
🌐 Update translations for zh (add-missing) ( #15175 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
b4f81b40a8
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
311ce1cfa5
🌐 Update translations for ja (update-outdated) ( #15171 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
92cc0bd9de
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
7e63d4250a
🌐 Update translations for ko (update-outdated) ( #15170 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
9d6ee88e8f
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
d90c38572b
🌐 Update translations for tr (update-outdated) ( #15172 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
a28b785ed7
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
07dfa9a5ae
🌐 Update translations for ko (add-missing) ( #15168 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
019471bc6c
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
bd1305c796
🌐 Update translations for ja (add-missing) ( #15167 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
bdb0b2d6dd
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
f00bd2be07
🌐 Update translations for tr (add-missing) ( #15169 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
aa62c2f8df
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
fdf31c110b
🌐 Update translations for fr (update-outdated) ( #15165 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
c457177969
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
98d3f9a2e8
🌐 Update translations for fr (add-missing) ( #15163 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
fe5332fbed
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
f97b72a754
🌐 Update translations for uk (update-outdated) ( #15160 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
7451444663
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
dc689a9ee3
🌐 Update translations for uk (add-missing) ( #15158 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
9671f78d29
📝 Update release notes
[skip ci]
3 months ago
github-actions[bot]
9dc22c3f1d
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
40301c86ee
🌐 Update translations for pt (update-outdated) ( #15159 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
Sebastián Ramírez
06cdff4488
🌐 Update translations for pt (add-missing) ( #15157 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
2742546af6
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
869de156e8
🌐 Update translations for es (update-outdated) ( #15155 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
75e5fdfef8
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
cd5869b897
🌐 Update translations for es (add-missing) ( #15154 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago
github-actions[bot]
b61bdb79b8
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
63f89410ed
🌐 Update translations for de (update-outdated) ( #15156 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
ab1a792b70
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
12cf2bd854
🌐 Update translations for ru (update-and-add) ( #15152 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
3 months ago
github-actions[bot]
48f8e87691
📝 Update release notes
[skip ci]
3 months ago
Sebastián Ramírez
96beaeb167
🌐 Update translations for de (add-missing) ( #15153 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 months ago