Closed JobaDiniz closed 2 months ago
@JobaDiniz Hi,
container = Container()
container.wire(modules=[__name__])
@JobaDiniz
I haven't solved.
@app.get("/")
async def read_root(request: Request) -> datetime.datetime:
# and here build dependency and pass data from request to needed methods
some_object = await container.DIContainer.dependent_factory()
some_object.some_method(request)
wiring
. What's the alternative and why it does not matter? What do I need to change?dependency_injector
for fastapi. Doesthat-depends
support passing therequest: Request
into the dependency?https://that-depends.readthedocs.io/introduction/fastapi.html
In the above example, I need that the instance of
dependent_factory
to have access to therequest
object of fastapi. How can this be implemented?