diff --git a/fastapi/dependencies/models.py b/fastapi/dependencies/models.py index d0783c8f0..3d3567d03 100644 --- a/fastapi/dependencies/models.py +++ b/fastapi/dependencies/models.py @@ -33,7 +33,9 @@ class Dependant: use_cache: bool = True path: Optional[str] = None scope: Literal["function", "request"] = "request" - cache_key: Tuple[Optional[Callable[..., Any]], Tuple[str, ...], str] = field(init=False) + cache_key: Tuple[Optional[Callable[..., Any]], Tuple[str, ...], str] = field( + init=False + ) def __post_init__(self) -> None: self.cache_key = ( diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index ca889c7cb..0620428be 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -153,6 +153,7 @@ class DependencyScopeError(FastAPIError): (narrower) scope. """ + class ValidationException(Exception): def __init__(self, errors: Sequence[Any]) -> None: self._errors = errors