Syed Osama Ali Shah
856dd03c24
Merge da3cd29314 into afe41126f6
2 days ago
Osamaali313
da3cd29314
Fix UnboundLocalError in OpenAPI generation for custom response classes
In `get_openapi_path`, `status_code` is assigned only inside the branches:
if route.status_code is not None:
status_code = str(route.status_code)
else:
response_signature = inspect.signature(current_response_class.__init__)
status_code_param = response_signature.parameters.get("status_code")
if status_code_param is not None:
if isinstance(status_code_param.default, int):
status_code = str(status_code_param.default)
operation.setdefault("responses", {}).setdefault(status_code, {})["description"] = ...
When `route.status_code is None` and the response class's `__init__` has no
`status_code` parameter (or its default is not an `int`), `status_code` is
never bound, but the following line uses it as a dict key -> `UnboundLocalError`.
This is reachable with a common pattern: a custom `response_class` whose
`__init__` is `def __init__(self, *args, **kwargs)` (or types `status_code`
as `int | None = None`). Because `get_openapi_path` -> `get_openapi` ->
`Application.openapi()`, a single such route makes `app.openapi()` raise,
taking down `/openapi.json`, `/docs`, and `/redoc` for the whole app.
Initialize `status_code` to "200" (FastAPI's default route status) before the
branches so it is always bound; the working paths are unchanged.
2 days ago
github-actions[bot]
afe41126f6
📝 Update release notes
[skip ci]
5 days ago
Sebastián Ramírez
7f05e26d08
🔥 Remove now-obsolete scripts to generate data for FastAPI People ( #16016 )
5 days ago
github-actions[bot]
efcf8a1830
📝 Update release notes
[skip ci]
5 days ago
Sebastián Ramírez
e735449bae
📝 Restructure FastAPI People and related pages ( #16015 )
5 days ago
Sebastián Ramírez
866b7a3d0c
🔖 Release version 0.139.2 ( #16014 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 days ago
github-actions[bot]
7b3effea75
📝 Update release notes
[skip ci]
5 days ago
Sebastián Ramírez
7fe315c21a
🐛 Refactor router route building to make it thread-safe, mainly relevant for tests running in parallel threads (uncommon) ( #16013 )
5 days ago
Sebastián Ramírez
c48e67b1ce
🔖 Release version 0.139.1 ( #16012 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 days ago
github-actions[bot]
2acc4fbf15
📝 Update release notes
[skip ci]
5 days ago
Sebastián Ramírez
eb75fd078e
🐛 Fix frontend fallback support for doted paths like `/users/john.doe` ( #16011 )
5 days ago
github-actions[bot]
9b8410bdc9
📝 Update release notes
[skip ci]
6 days ago
Yurii Motov
e24d44cce4
📝 Fix topic repository list not being displayed and `skip_users` not being applied ( #15995 )
6 days ago
github-actions[bot]
93b78f8646
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
b959b44357
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
20d332cb2e
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
061eb10016
📝 Update release notes
[skip ci]
6 days ago
Sebastián Ramírez
8f93206768
🌐 Update translations for tr (update-outdated) ( #16005 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
5ca69d4626
🌐 Update translations for zh-hant (update-outdated) ( #15996 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
github-actions[bot]
38c6686015
📝 Update release notes
[skip ci]
6 days ago
Sebastián Ramírez
1bea40556e
🌐 Update translations for fr (update-outdated) ( #16006 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
github-actions[bot]
3330e247ce
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
569630f646
📝 Update release notes
[skip ci]
6 days ago
Sebastián Ramírez
362c6f1d3f
🌐 Update translations for de (update-outdated) ( #15999 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
10f30b844b
🌐 Update translations for ko (update-outdated) ( #16004 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
4cb38a4809
🌐 Update translations for zh (update-outdated) ( #16001 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
745d3d222f
🌐 Update translations for uk (update-outdated) ( #16003 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
github-actions[bot]
8458d35c96
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
75bdc46293
📝 Update release notes
[skip ci]
6 days ago
github-actions[bot]
c29b4a17af
📝 Update release notes
[skip ci]
6 days ago
Sebastián Ramírez
3a8ab1f76b
🌐 Update translations for ja (update-outdated) ( #15998 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
github-actions[bot]
b10d3dac4c
📝 Update release notes
[skip ci]
6 days ago
Sebastián Ramírez
1d02512ce3
🌐 Update translations for pt (update-outdated) ( #16000 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
24a957b5b0
🌐 Update translations for es (update-outdated) ( #15997 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
Sebastián Ramírez
2ebfb7a7bc
🌐 Update translations for ru (update-outdated) ( #16002 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 days ago
github-actions[bot]
027f27220c
📝 Update release notes
[skip ci]
7 days ago
Sebastián Ramírez
37ccca3e95
🌐 Update translations for hi (add-missing) ( #15990 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 days ago
github-actions[bot]
64fc8a4521
📝 Update release notes
[skip ci]
1 week ago
Sebastián Ramírez
e5d61c34a3
🌐 Update translations for hi (add-missing) ( #15925 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
1 week ago
github-actions[bot]
b1346bb142
📝 Update release notes
[skip ci]
1 week ago
dependabot[bot]
9405816f15
⬆ Bump the python-packages group across 1 directory with 6 updates ( #15981 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 week ago
github-actions[bot]
fd4c4cfc3e
📝 Update release notes
[skip ci]
1 week ago
dependabot[bot]
87bbab1b73
⬆ Bump typing-extensions from 4.15.0 to 4.16.0 ( #15982 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 week ago
github-actions[bot]
b335c906e1
📝 Update release notes
[skip ci]
1 week ago
dependabot[bot]
2b0b417c0c
⬆ Bump the github-actions group across 1 directory with 4 updates ( #15983 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 week ago
github-actions[bot]
c9d88e33d8
📝 Update release notes
[skip ci]
1 week ago
Sebastián Ramírez
ef3f1ac9c1
⬆ Bump pre-commit hooks ( #15985 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 week ago
github-actions[bot]
cf93cc6258
📝 Update release notes
[skip ci]
1 week ago
Yurii Motov
b75bd318f3
👷 Use `FASTAPI_LATEST_CHANGES` token in `bump-pre-commit-hooks` workflow ( #15984 )
1 week ago