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.
The text was updated successfully, but these errors were encountered:
juanmarin96
changed the title
Dependency Injector stop work after update from 4.5.1 to 4.52
Dependency Injector stops work after upgrade from 4.5.1 to 4.52
Dec 5, 2020
Hey @juanmarin96, I’m sorry I got it broken. Thanks for reporting the issue. I’m away from computer to debug now, but I’ll definitely take a look later today.
I have this method router method wich resolve correctly the depency in version 4.51
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 actuallyproduct_service
is an instance of Provide not aProductService
as I need it.The text was updated successfully, but these errors were encountered: