Replies: 2 comments 1 reply
-
There is no solution for this at this time. It's sad that the maintainers are not following the project and responding to issues. I would have been ready to implement this, except there has been absolutely no response. Closing. |
Beta Was this translation helpful? Give feedback.
1 reply
-
@tiangolo good day! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Example Code
Description
I expect
/contextmanager
to work the same as/generator
, but it doesn't. FastAPI does not usecontextmanager_dependency
as a context manager, and instead of executing it and substituting the result, it just substitutes the initializedcontextlib._GeneratorContextManager
class intodep
.I suggest adding support for
contextmanager
andasynccontextmanager
to the DI system, as they are more convenient to use outside of the DI system.Operating System
Linux
Operating System Details
No response
FastAPI Version
0.109.2
Pydantic Version
2.6.1
Python Version
Python 3.12.1
Additional Context
Exception traceback at
/contextmanager
:Beta Was this translation helpful? Give feedback.
All reactions