g7azazlo
40af1b90c3
Enhance response model inference and improve error handling
- Updated the response model inference logic in "APIRoute" to check for "None" before validating against "BaseModel".
- Refined the "infer_response_model_from_ast" function to handle nested function definitions and invalid dictionary keys, ensuring robust schema generation.
- Added new test cases for edge scenarios to validate the inference behavior.
8 months ago
g7azazlo
72b210209b
Implement response model inference from endpoint function source code
- Added "infer_response_model_from_ast" function to analyze endpoint functions and infer Pydantic models from returned dictionary literals or variable assignments.
- Updated "APIRoute" to utilize the new inference method when the specified response model is not a subclass of "BaseModel"
8 months ago
Sebastián Ramírez
c57ac7bdf3
🔖 Release version 0.123.5
8 months ago
Lie Ryan
9824486616
✨ Allow using dependables with `functools.partial()` ( #9753 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
8 months ago
[object Object]
1c1e584abd
✨ Add support for wrapped functions (e.g. `@functools.wraps()`) used with forward references ( #5077 )
Co-authored-by: Yurii Karabas <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
8 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] >
8 months ago
Sebastián Ramírez
a79ae3d66f
🔥 Remove dangling extra condiitonal no longer needed ( #14435 )
8 months ago
Sebastián Ramírez
247ef32e79
♻️ Refactor internals, update `is_coroutine` check to reuse internal supported variants (unwrap, check class) ( #14434 )
8 months ago
Matthew Martin
73c411e1b9
✨ Handle wrapped dependencies ( #9555 )
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
8 months ago
Sebastián Ramírez
4976568fc7
🔖 Release version 0.123.4
8 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] >
8 months ago
Motov Yurii
dcf0299195
📝 Fix docstring of `servers` parameter ( #14405 )
Co-authored-by: Sebastián Ramírez <[email protected] >
8 months ago
Sebastián Ramírez
c516c9904b
🔖 Release version 0.123.3
8 months ago
Motov Yurii
015b4fae9c
🐛 Fix Query\Header\Cookie parameter model alias ( #14360 )
Co-authored-by: Sebastián Ramírez <[email protected] >
8 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] >
8 months ago
Sebastián Ramírez
3c54a8f07b
🔖 Release version 0.123.2
8 months ago
Alex Colby
cb3792d39e
🐛 Fix unformatted `{type_}` in FastAPIError ( #14416 )
Co-authored-by: Alex Colby <[email protected] >
8 months ago
Motov Yurii
de5bec637c
🐛 Fix parsing extra non-body parameter list ( #14356 )
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
Motov Yurii
6cf40df24d
🐛 Fix parsing extra `Form` parameter list ( #14303 )
Co-authored-by: Sebastián Ramírez <[email protected] >
8 months ago
ad hoc
d68c066246
🐛 Fix support for form values with empty strings interpreted as missing (`None` if that's the default), for compatibility with HTML forms ( #13537 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Sebastián Ramírez <[email protected] >
8 months ago
Sebastián Ramírez
c3373205d0
🔖 Release version 0.123.1
8 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>
8 months ago
Kent Huang
20f40b29c0
🐛 Fix `TypeError` when encoding a decimal with a `NaN` or `Infinity` value ( #12935 )
Signed-off-by: Kent Huang <[email protected] >
8 months ago
Sebastián Ramírez
f2bab95267
🔖 Release version 0.123.0
8 months ago
Sebastián Ramírez
7fbd30460f
🐛 Cache dependencies that don't use scopes and don't have sub-dependencies with scopes ( #14419 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Sebastián Ramírez
63d7a2b997
🔖 Release version 0.122.1
8 months ago
Kristján Valur Jónsson
378ad688b7
🐛 Fix hierarchical security scope propagation ( #5624 )
Co-authored-by: Sebastián Ramírez <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: svlandeg <[email protected] >
Co-authored-by: Sofie Van Landeghem <[email protected] >
8 months ago
Sebastián Ramírez
5b0625df96
🔖 Release version 0.122.0
8 months ago
Motov Yurii
51ad909ffe
🐛 Use `401` status code in security classes when credentials are missing ( #13786 )
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
325fd16d32
🔖 Release version 0.121.3
8 months ago
Sebastián Ramírez
85701631a0
♻️ Make the result of `Depends()` and `Security()` hashable, as a workaround for other tools interacting with these internal parts ( #14372 )
8 months ago
Sebastián Ramírez
02e108d166
🔖 Release version 0.121.2
8 months ago
Sebastián Ramírez
5d40dfbc9b
🐛 Fix handling of JSON Schema attributes named "$ref" ( #14349 )
8 months ago
Sebastián Ramírez
1c7e2540c2
🔖 Release version 0.121.1
8 months ago
luzzodev
282f372eda
🐛 Fix `Depends(func, scope='function')` for top level (parameterless) dependencies ( #14301 )
8 months ago
Sebastián Ramírez
4efae81a76
🔖 Release version 0.121.0
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
Sebastián Ramírez
fad35ef43f
🔖 Release version 0.120.4
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
2cf04ee30d
🔖 Release version 0.120.3
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
Sebastián Ramírez
22ccca21fc
🔖 Release version 0.120.2
9 months ago
Sebastián Ramírez
6a657f360d
🐛 Fix separation of schemas with nested models introduced in 0.119.0 ( #14246 )
9 months ago
Sebastián Ramírez
78c94c3f56
🔖 Release version 0.120.1
9 months ago
Sebastián Ramírez
cd40c5b40f
🔖 Release version 0.120.0
9 months ago
Sebastián Ramírez
d390f2e41f
➕ Migrate internal reference documentation from `typing_extensions.Doc` to `annotated_doc.Doc` ( #14222 )
9 months ago
Sebastián Ramírez
864b569cf8
🔖 Release version 0.119.1
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] >
9 months ago