Skip to content

Dependency Injector stops work after upgrade from 4.5.1 to 4.52 #331

@juanmarin96

Description

@juanmarin96

I have this method router method wich resolve correctly the depency in version 4.51

import logging from typing import Any, List from dependency_injector.wiring import Provide, inject from fastapi.routing import APIRouter from app.core.containers import Containers from app.core.product.entities.product import ProductBase from app.core.product.services.product import ProductService router = APIRouter() @router.get('/', response_model=List[ProductBase]) @inject async def read_products( skip: int = 0, limit: int = 100, product_service: ProductService = Depends(Provide[Containers.product]), ) -> Any: products = await product_service.get_multi(skip=skip, limit=limit) return products 

But when I upgraded it to 4.5.2 to fixe this behavior -> #330 the Provide dependency get unresolved a throw: AttributeError: 'Provide' object has no attribute 'get_multi' and actually product_service is an instance of Provide not a ProductService as I need it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions