valbort
e893e7886b
🐛 Fix mypy type checking errors for Pydantic v2 optimizations
2 weeks ago
pre-commit-ci-lite[bot]
30ef0e833a
🎨 Auto format
2 weeks ago
valbort
40e2198b15
⚡ Cache pydantic.v1 import to minimize compatibility overhead
Moving the import of pydantic.v1 and the warnings filter to the module level avoids executing them on every single object serialization in jsonable_encoder, significantly boosting performance for Pydantic v1 backward compatibility checks.
2 weeks ago
valbort
1bffdc5f36
Optimize JSON parsing by using Pydantic V2 validate_json directly from request body bytes. - Add FastAPIOptimizedJsonBytes helper to mark bytes for optimized parsing. - Implement validate_json in ModelField to leverage pydantic-core's native JSON parsing. - Update get_request_handler to pass raw body bytes wrapped in FastAPIOptimizedJsonBytes when applicable. - Update _validate_value_with_model_field to use validate_json when receiving optimized bytes, avoiding redundant Python dict conversion.
Co-authored-by: Junie <[email protected] >
3 weeks ago
dependabot[bot]
5d5666bec5
⬆ Bump ty from 0.0.21 to 0.0.34 ( #15443 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: svlandeg <[email protected] >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
4 weeks ago
Sofie Van Landeghem
7815a32f2e
⬆️ Update Pydantic v2 code to address deprecations ( #15101 )
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2 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
Sebastián Ramírez
590a5e5355
✨ Serialize JSON response with Pydantic (in Rust), when there's a Pydantic return type or response model ( #14962 )
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
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
2e7d3754cd
♻️ Refactor and simplify Pydantic v2 (and v1) compatibility internal utils ( #14862 )
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
261736ab4c
💡 Update comment for Pydantic internals ( #14814 )
4 months ago
Motov Yurii
f3f498100f
👷 Run mypy by pre-commit ( #14806 )
Co-authored-by: Sebastián Ramírez <[email protected] >
4 months ago
Sebastián Ramírez
e300630551
➖ Drop support for `pydantic.v1` ( #14609 )
5 months ago
Sebastián Ramírez
e2cd8a4201
➖ Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` ( #14575 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Sebastián Ramírez
1c4fc96c91
♻️ Upgrade internal syntax to Python 3.9+ 🎉 ( #14564 )
6 months ago
Sebastián Ramírez
ed97d9dc0c
⚰️ Remove Python 3.8 from CI and remove Python 3.8 examples from source docs ( #14559 )
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
6 months ago
Motov Yurii
d86c47477e
🐛 Fix parameter aliases ( #14371 )
Co-authored-by: Sebastián Ramírez <[email protected] >
6 months ago
Sebastián Ramírez
c0556ac3a5
🐛 Fix support for tagged union with discriminator inside of `Annotated` with `Body()` ( #14512 )
6 months ago
Sebastián Ramírez
42b250d14d
🐛 Fix handling arbitrary types when using `arbitrary_types_allowed=True` ( #14482 )
6 months ago
Motov Yurii
812a1926f0
🐛 Fix `separate_input_output_schemas=False` with `computed_field` ( #14453 )
6 months ago
Victorien
80d69ae0bb
🐛 Fix optional sequence handling with new union syntax from Python 3.10 ( #14430 )
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <[email protected] >
6 months ago
Vincent Grafé
f95a174288
🐛 Fix OpenAPI schema support for computed fields when using `separate_input_output_schemas=False` ( #13207 )
Co-authored-by: Sofie Van Landeghem <[email protected] >
Co-authored-by: svlandeg <[email protected] >
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: svlandeg <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
6 months ago
Motov Yurii
0f613d9051
🐛 Fix optional sequence handling in `serialize sequence value` with Pydantic V2 ( #14297 )
Co-authored-by: Sebastián Ramírez <[email protected] >
6 months ago
Sofie Van Landeghem
8f99a2b734
🐛 Avoid accessing non-existing "$ref" key for Pydantic v2 compat remapping ( #14361 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
6 months ago
Sebastián Ramírez
5d40dfbc9b
🐛 Fix handling of JSON Schema attributes named "$ref" ( #14349 )
7 months ago
Sebastián Ramírez
6a657f360d
🐛 Fix separation of schemas with nested models introduced in 0.119.0 ( #14246 )
7 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] >
8 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>
8 months ago