essentiaMarco
8b2028cb25
fix: normalize lifespan (async/sync gen) before wrapper so router_events tests pass
- In FastAPI.__init__, when lifespan is an async or sync generator function,
convert to context manager (asynccontextmanager / _wrap_gen_lifespan_context)
before _wrap_lifespan_with_dependency_cache so orig_cm has __aenter__/__aexit__.
Made-with: Cursor
3 months ago
essentiaMarco
53ebb9b46a
fix: resolve merge with master — lifespan app vs router
- Default lifespan: use app.router for _DefaultLifespan (router has
_startup/_shutdown; FastAPI app does not).
- Wrapper: when app is FastAPI, set fastapi_app from app and pass
app.router to _run_lifespan_dependencies so lifespan deps are collected.
- Test: use only Request.receive() (Starlette Request has no .send).
Made-with: Cursor
3 months ago
essentiaMarco
df44ff0d9e
feat: lifespan dependency scope (applications, deps, params)
- Wire lifespan-scoped deps in applications.py via _wrap_lifespan_with_dependency_cache
- Extend Depends(..., scope=...) with 'lifespan' in params/models/utils
- Resolved with merge of origin/master
Made-with: Cursor
3 months ago
Sofie Van Landeghem
98b269b51e
👷 Add `ty` to precommit ( #15091 )
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
3 months ago
essentiaMarco
9fb0fc8120
refactor(lifespan): align with reviewer feedback, add coverage tests
- Fix _collect_lifespan_dependants: handle route-level flat.computed_scope
and iterate flat.dependencies (was incorrectly iterating flat)
- No pragmas on noop_receive/noop_send; covered by test that uses
Request.receive/send in a lifespan dependency
- Add test_collect_lifespan_dependants_route_level_scope for route-level
lifespan branch
- Add test_lifespan_dependency_synthetic_request_receive_send for
noop_receive/noop_send coverage
- Add test_lifespan_dependency_nested for dependency_cache hit (utils)
- Add test_lifespan_dependency_cannot_depend_on_request_scope and
test_lifespan_dependency_not_initialized_raises for edge cases
Made-with: Cursor
3 months ago
Motov Yurii
8b0090c39b
📝 Fix doctrings for `max_digits` and `decimal_places` ( #14944 )
Fix doctrings for `max_digits` and `decimal_places`
3 months ago
Sebastián Ramírez
ca5f60ee72
🔖 Release version 0.135.1
3 months ago
Sebastián Ramírez
8a9258b169
🐛 Fix, avoid yield from a TaskGroup, only as an async context manager, closed in the request async exit stack ( #15038 )
3 months ago
Sebastián Ramírez
924a535a4f
📝 Update Skill, optimize context, trim and refactor into references ( #15031 )
3 months ago
Sebastián Ramírez
12ea7be0be
🔖 Release version 0.135.0
3 months ago
Sebastián Ramírez
2238155844
✨ Add support for Server Sent Events ( #15030 )
3 months ago
Sebastián Ramírez
d98eb74da9
🔖 Release version 0.134.0
3 months ago
Sebastián Ramírez
c01dc8b03c
📝 Update Library Agent Skill with streaming responses ( #15024 )
3 months ago
Sebastián Ramírez
749cefdeb1
✨ Add support for streaming JSON Lines and binary data with `yield` ( #15022 )
3 months ago
Sebastián Ramírez
728b097564
🔖 Release version 0.133.1
3 months ago
Sebastián Ramírez
4fce9ce172
🔧 Add FastAPI Agents Skill ( #14982 )
Co-authored-by: Sofie Van Landeghem <[email protected] >
Co-authored-by: Alejandra <[email protected] >
3 months ago
Sebastián Ramírez
daba0aa328
🔖 Release version 0.133.0
3 months ago
Sebastián Ramírez
6c68838615
🔖 Release version 0.132.1
3 months ago
Sebastián Ramírez
2686c7fbbf
♻️ Refactor logic to handle OpenAPI and Swagger UI escaping data ( #14986 )
3 months ago
Sebastián Ramírez
5c863d0718
🔖 Release version 0.132.0
3 months ago
Sebastián Ramírez
22354a2530
🔒 ️ Add `strict_content_type` checking for JSON requests ( #14978 )
3 months ago
Sebastián Ramírez
b423b73c35
🔖 Release version 0.131.0
3 months ago
Sebastián Ramírez
48e9835732
🗑️ Deprecate `ORJSONResponse` and `UJSONResponse` ( #14964 )
3 months ago
Sebastián Ramírez
eb544e704c
🔖 Release version 0.130.0
3 months ago
Sebastián Ramírez
590a5e5355
✨ Serialize JSON response with Pydantic (in Rust), when there's a Pydantic return type or response model ( #14962 )
3 months ago
Sebastián Ramírez
1e78a36b73
🔖 Release version 0.129.2
4 months ago
Sebastián Ramírez
c91fed958e
🔖 Release version 0.129.1
4 months ago
Sebastián Ramírez
e8b98d2187
🐛 Fix JSON Schema for files, use `contentMediaType` instead of `format: binary` ( #14953 )
4 months ago
Sebastián Ramírez
a2e51363c7
🔖 Release version 0.129.0
4 months ago
Sebastián Ramírez
3da206c06d
🎨 Update internal types for Python 3.10 ( #14898 )
4 months ago
Sebastián Ramírez
ad4e8e0060
➖ Drop support for Python 3.9 ( #14897 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
4 months ago
Sebastián Ramírez
bdd20051c4
🔖 Release version 0.128.8
4 months ago
Sebastián Ramírez
8f82c94de0
🔖 Release version 0.128.7
4 months ago
Sebastián Ramírez
25270fcee0
♻️ Simplify reading files in memory, do it sequentially instead of (fake) parallel ( #14884 )
4 months ago
Javier Sánchez Castro
df950111fe
✨ Show a clear error on attempt to include router into itself ( #14258 )
Co-authored-by: Javier Sánchez <[email protected] >
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
4 months ago
rijenkii
66dc695071
✨ Replace `dict` by `Mapping` on `HTTPException.headers` ( #12997 )
Co-authored-by: Alejandra <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
4 months ago
Sebastián Ramírez
0a4033aeee
🔖 Release version 0.128.6
4 months ago
Motov Yurii
ed2512a5ec
🐛 Fix `on_startup` and `on_shutdown` parameters of `APIRouter` ( #14873 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
4 months ago
Sebastián Ramírez
dedf1409fe
🔖 Release version 0.128.5
4 months ago
Sebastián Ramírez
2e7d3754cd
♻️ Refactor and simplify Pydantic v2 (and v1) compatibility internal utils ( #14862 )
4 months ago
Sebastián Ramírez
8eac94bd91
🔖 Release version 0.128.4
4 months ago
Sebastián Ramírez
d59fbc3494
♻️ Refactor internals, simplify Pydantic v2/v1 utils, `create_model_field`, better types for `lenient_issubclass` ( #14860 )
4 months ago
Sebastián Ramírez
cf55bade7e
♻️ Simplify internals, remove Pydantic v1 only logic, no longer needed ( #14857 )
4 months ago
Sebastián Ramírez
3c49346238
♻️ Refactor internals, cleanup unneeded Pydantic v1 specific logic ( #14856 )
4 months ago
Sebastián Ramírez
36985f5f25
🔖 Release version 0.128.3
4 months ago
Sebastián Ramírez
f9f7992604
♻️ Re-implement `on_event` in FastAPI for compatibility with the next Starlette, while keeping backwards compatibility ( #14851 )
4 months ago
Sebastián Ramírez
79406a4b04
🔖 Release version 0.128.2
4 months ago
Kanetsuna Masaya
c5fd75a321
🐛 Fix using `Json[list[str]]` type (issue #10997 ) ( #14616 )
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
4 months ago
Albin Skott
97145588f5
✨ Add support for PEP695 `TypeAliasType` ( #13920 )
Co-authored-by: lokidev <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
4 months ago
Jonathan Fulton
b49435becd
✨ Allow `Response` type hint as dependency annotation ( #14794 )
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
4 months ago