pre-commit-ci-lite[bot]
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
6 additions and
3 deletions
-
fastapi/dependencies/utils.py
-
fastapi/routing.py
-
fastapi/types.py
|
|
|
@ -599,7 +599,9 @@ async def solve_dependencies( |
|
|
|
and dependency_overrides_provider.dependency_overrides |
|
|
|
): |
|
|
|
original_call = sub_dependant.call |
|
|
|
call = dependency_overrides_provider.dependency_overrides.get(original_call, original_call) |
|
|
|
call = dependency_overrides_provider.dependency_overrides.get( |
|
|
|
original_call, original_call |
|
|
|
) |
|
|
|
use_path: str = sub_dependant.path # type: ignore |
|
|
|
use_sub_dependant = get_dependant( |
|
|
|
path=use_path, |
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ from fastapi.exceptions import ( |
|
|
|
ResponseValidationError, |
|
|
|
WebSocketRequestValidationError, |
|
|
|
) |
|
|
|
from fastapi.types import DecoratedCallable, IncEx, DependencyOverridesProvider |
|
|
|
from fastapi.types import DecoratedCallable, DependencyOverridesProvider, IncEx |
|
|
|
from fastapi.utils import ( |
|
|
|
create_cloned_field, |
|
|
|
create_model_field, |
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import types |
|
|
|
from enum import Enum |
|
|
|
from typing import Any, Callable, Optional, TypeVar, Union, Protocol |
|
|
|
from typing import Any, Callable, Optional, Protocol, TypeVar, Union |
|
|
|
|
|
|
|
from pydantic import BaseModel |
|
|
|
|
|
|
|
@ -10,5 +10,6 @@ ModelNameMap = dict[Union[type[BaseModel], type[Enum]], str] |
|
|
|
IncEx = Union[set[int], set[str], dict[int, Any], dict[str, Any]] |
|
|
|
DependencyCacheKey = tuple[Optional[Callable[..., Any]], tuple[str, ...], str] |
|
|
|
|
|
|
|
|
|
|
|
class DependencyOverridesProvider(Protocol): |
|
|
|
dependency_overrides: dict[Callable[..., Any], Any] |
|
|
|
|