Nir Schulman
c0ad39e073
Fixed some linting and python 3.8 compatibility issues.
9 months ago
Nir Schulman
e563b874ba
Removed backwards compatibility since it doesn't actually preserves compatibility anyways.
9 months ago
Nir Schulman
8ca136455a
Exported some duplicated logic into a common _BaseDependant.
9 months ago
pre-commit-ci[bot]
b189030589
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
9 months ago
Sebastián Ramírez
ac438b9934
✨ Add support for dependencies with scopes, support `scope="request"` for dependencies with `yield` that exit before the response is sent ( #14262 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
9 months ago
Motov Yurii
496de1816a
🐛 Fix security schemes in OpenAPI when added at the top level app ( #14266 )
Co-authored-by: Sebastián Ramírez <[email protected] >
9 months ago
Sebastián Ramírez
dcfb8b9dda
♻️ Reduce internal cyclic recursion in dependencies, from 2 functions calling each other to 1 calling itself ( #14256 )
9 months ago
Sebastián Ramírez
bb88a0f94a
♻️ Refactor internals of dependencies, simplify code and remove `get_param_sub_dependant` ( #14255 )
9 months ago
Sebastián Ramírez
c144f9fbd3
♻️ Refactor internals of dependencies, simplify using dataclasses ( #14254 )
9 months ago
Sofie Van Landeghem
d8c691f7f0
🐛 Fix internal Pydantic v1 compatibility (warnings) for Python 3.14 and Pydantic 2.12.1 ( #14186 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <[email protected] >
10 months ago
Sebastián Ramírez
d34918abf0
✨ Add support for `from pydantic.v1 import BaseModel`, mixed Pydantic v1 and v2 models in the same app ( #14168 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
10 months ago
Thomas LÉVEIL
44fc67632b
🐛 Fix validation error when `File` is declared after `Form` parameter ( #11194 )
Co-authored-by: Sebastián Ramírez <[email protected] >
11 months ago
Robert Hofer
b51ec36f2e
✨ Allow `None` as return type for bodiless responses ( #9425 )
Co-authored-by: Sebastián Ramírez <[email protected] >
11 months ago
Evgeny Bokshitsky
c2c6049b8f
♻️ Create `dependency-cache` dict in `solve_dependencies` only if `None` (don't re-create if empty) ( #13689 )
11 months ago
rmawatson
9ac56c70f2
🐛 Reenable `allow_arbitrary_types` when only 1 argument is used on the API endpoint ( #13694 )
Co-authored-by: Sofie Van Landeghem <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
11 months ago
secrett2633
c831cdbde2
🐛 Fix `inspect.getcoroutinefunction()` can break testing with `unittest.mock.patch()` ( #14022 )
11 months ago
Patrick Arminio
9d0d8828cc
🐛 Fix support for unions when using `Form` ( #13827 )
1 year ago
Sebastián Ramírez
2537d9d1c2
🐛 Fix `convert_underscores=False` for header Pydantic models ( #13515 )
1 year ago
dependabot[bot]
8c94e97c89
⬆ Bump ruff to 0.9.4 ( #13299 )
* ⬆ Bump ruff from 0.6.4 to 0.9.4
Bumps [ruff](https://github.com/astral-sh/ruff ) from 0.6.4 to 0.9.4.
- [Release notes](https://github.com/astral-sh/ruff/releases )
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md )
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.4...0.9.4 )
---
updated-dependencies:
- dependency-name: ruff
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected] >
* update pre-commit accordingly and make formatting changes
* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
---------
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandra <[email protected] >
Co-authored-by: svlandeg <[email protected] >
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 year ago
Sebastián Ramírez
74fe89bf35
🐛 Add docs examples and tests (support) for `Annotated` custom validations, like `AfterValidator`, revert #13440 ( #13442 )
This reverts commit 15dd2b67d3 .
1 year ago
Victorien
15dd2b67d3
♻️ Update internal annotation usage for compatibilty with Pydantic 2.11 ( #13314 )
Co-authored-by: Sofie Van Landeghem <[email protected] >
Co-authored-by: svlandeg <[email protected] >
1 year ago
Nir Schulman
8a5c3fe56b
Fixed more linting
2 years ago
pre-commit-ci[bot]
f9ca77e1ec
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
2 years ago
Nir Schulman
01e9da1ca2
Added coverage
2 years ago
Nir Schulman
d512b03bd3
Applied ruff linting
2 years ago
Nir Schulman
c4860bfb7c
Added tests for dependency overrides and websockets. Fixed bugs related to the deprecated startup and shutdown events. Fixed bugs related to dependency duplcatation within the same router scope. Made more specific dependency related exceptions. Fixed some linting and mypy related issues.
2 years ago
Sebastián Ramírez
b31cbbf5f5
♻️ Update logic to import and check `python-multipart` for compatibility with newer version ( #12627 )
2 years ago
pre-commit-ci[bot]
54ecfb87d8
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
2 years ago
Nir Schulman
25407d039a
Added support for lifespan-scoped dependencies using a new dependency_scope argument.
2 years ago
José Pacheco
8ae4603d68
🐛 Remove `Required` shadowing from fastapi using Pydantic v2 ( #12197 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <[email protected] >
2 years ago
Sebastián Ramírez
40490abaa3
♻️ Update type annotations for improved `python-multipart` ( #12407 )
2 years ago
Sebastián Ramírez
55035f440b
✨ Add support for Pydantic models for parameters using `Query`, `Cookie`, `Header` ( #12199 )
2 years ago
Nico Tonnhofer
88d4f2cb18
🐛 Fix form field regression ( #12194 )
2 years ago
Sebastián Ramírez
b0eedbb580
⚡ ️ Improve performance in request body parsing with a cache for internal model fields ( #12184 )
2 years ago
Sebastián Ramírez
4633b1bca9
✨ Add support for forbidding extra form fields with Pydantic models ( #12134 )
Co-authored-by: Sofie Van Landeghem <[email protected] >
2 years ago
Sebastián Ramírez
7bad7c0975
✨ Add support for Pydantic models in `Form` parameters ( #12129 )
Revert "⏪ ️ Temporarily revert "✨ Add support for Pydantic models in `Form` pa…"
This reverts commit 8e6cf9ee9c .
2 years ago
Sebastián Ramírez
8e6cf9ee9c
⏪ ️ Temporarily revert " ✨ Add support for Pydantic models in `Form` parameters" to make a checkpoint release ( #12128 )
Revert "✨ Add support for Pydantic models in `Form` parameters (#12127 )"
This reverts commit 0f3e65b007 .
2 years ago
Sebastián Ramírez
0f3e65b007
✨ Add support for Pydantic models in `Form` parameters ( #12127 )
2 years ago
Sebastián Ramírez
aa21814a89
♻️ Refactor deciding if `embed` body fields, do not overwrite fields, compute once per router, refactor internals in preparation for Pydantic models in `Form`, `Query` and others ( #12117 )
2 years ago
Sebastián Ramírez
23bda0ffeb
♻️ Refactor internal `check_file_field()`, rename to `ensure_multipart_is_installed()` to clarify its purpose ( #12106 )
2 years ago
Sebastián Ramírez
d08b95ea57
♻️ Rename internal `create_response_field()` to `create_model_field()` as it's used for more than response models ( #12103 )
2 years ago
Sebastián Ramírez
5b7fa3900e
♻️ Refactor and simplify internal data from `solve_dependencies()` using dataclasses ( #12100 )
2 years ago
Sebastián Ramírez
08547e1d57
♻️ Refactor and simplify internal `analyze_param()` to structure data with dataclasses instead of tuple ( #12099 )
2 years ago
Sebastián Ramírez
581aacc4a9
♻️ Refactor and simplify dependencies data structures with dataclasses ( #12098 )
2 years ago
Sebastián Ramírez
3a3ad5d66d
⬆️ Upgrade version of Ruff and reformat ( #12032 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2 years ago
Nadav Zingerman
eec612ca8d
🐛 Fix parameterless `Depends()` with generics ( #9479 )
Co-authored-by: Sebastián Ramírez <[email protected] >
2 years ago
Charlie Marsh
5ccc869fee
⬆️ Upgrade configuration for Ruff v0.2.0 ( #11075 )
2 years ago
Sebastián Ramírez
a4aa79e0b4
✨ Add support for raising exceptions (including `HTTPException`) in dependencies with `yield` in the exit code, do not support them in background tasks ( #10831 )
* ♻️ Refactor dependency AsyncExitStack logic, exit dependencies after creating the response, before sending it
* ✅ Update tests for dependencies exit, check they are finished before the response is sent
* 🔥 Remove ExitAsyncStackMiddleware as it's no longer needed
* 📝 Update docs for dependencies with yield
* 📝 Update release notes
* 📝 Add source examples for new dependencies with yield raising
* ✅ Add tests for new dependencies raising after yield
* 📝 Update release notes
3 years ago
Sebastián Ramírez
6f5aa81c07
✨ Add support for multiple Annotated annotations, e.g. `Annotated[str, Field(), Query()]` ( #10773 )
3 years ago
Sebastián Ramírez
05ca41cfd1
✨ Add reference (code API) docs with PEP 727, add subclass with custom docstrings for `BackgroundTasks`, refactor docs structure ( #10392 )
* ➕ Add mkdocstrings and griffe-typingdoc to dependencies
* 🔧 Add mkdocstrings configs to MkDocs
* 📝 Add first WIP reference page
* ⬆️ Upgrade typing-extensions to the minimum version including Doc()
* 📝 Add docs to FastAPI parameters
* 📝 Add docstrings for OpenAPI docs utils
* 📝 Add docstrings for security utils
* 📝 Add docstrings for UploadFile
* 📝 Update docstrings in FastAPI class
* 📝 Add docstrings for path operation methods
* 📝 Add docstring for jsonable_encoder
* 📝 Add docstrings for exceptions
* 📝 Add docstsrings for parameter functions
* 📝 Add docstrings for responses
* 📝 Add docstrings for APIRouter
* ♻️ Sub-class BackgroundTasks to document it with docstrings
* 📝 Update usage of background tasks in dependencies
* ✅ Update tests with new deprecation warnings
* 📝 Add new reference docs
* 🔧 Update MkDocs with new reference docs
* ✅ Update pytest fixture, deprecation is raised only once
* 🎨 Update format for types in exceptions.py
* ♻️ Update annotations in BackgroundTask, `Annotated` can't take ParamSpec's P.args or P.kwargs
* ✏️ Fix typos caught by @pawamoy
* 🔧 Update and fix MkDocstrings configs from @pawamoy tips
* 📝 Update reference docs
* ✏️ Fix typos found by @pawamoy
* ➕ Add HTTPX as a dependency for docs, for the TestClient
* 🔧 Update MkDocs config, rename websockets reference
* 🔇 Add type-ignores for Doc as the stubs haven't been released for mypy
* 🔥 Remove duplicated deprecated notice
* 🔇 Remove typing error for unreleased stub in openapi/docs.py
* ✅ Add tests for UploadFile for coverage
* ⬆️ Upgrade griffe-typingdoc==0.2.2
* 📝 Refactor docs structure
* 🔨 Update README generation with new index frontmatter and style
* 🔨 Update generation of languages, remove from top menu, keep in lang menu
* 📝 Add OpenAPI Pydantic models
* 🔨 Update docs script to not translate Reference and Release Notes
* 🔧 Add reference for OpenAPI models
* 🔧 Update MkDocs config for mkdocstrings insiders
* 👷 Install mkdocstring insiders in CI for docs
* 🐛 Fix MkDocstrings insiders install URL
* ➕ Move dependencies shared by docs and tests to its own requirements file
* 👷 Update cache keys for test and docs dependencies
* 📝 Remove no longer needed __init__ placeholder docstrings
* 📝 Move docstring for APIRouter to the class level (not __init__ level)
* 🔥 Remove no longer needed dummy placeholder __init__ docstring
3 years ago