SolvedDependency
This class represents the result of a resolved dependency graph, encapsulating the extracted values and any encountered errors. It maintains state for background tasks, the associated response object, and a cache to optimize dependency resolution across the request lifecycle.
Attributes
| Attribute | Type | Description |
|---|---|---|
| values | dict[str, Any] | A mapping of parameter names to their resolved dependency values used for injection into the endpoint function. |
| errors | list[Any] | A list of validation errors or exceptions encountered during the dependency resolution process. |
| background_tasks | `StarletteBackgroundTasks | None` |
| response | [Response](../../openapi/models/response.md?sid=fastapi_openapi_models_response) | The Starlette Response object used to manage cookies and headers modified by dependencies during resolution. |
| dependency_cache | dict[DependencyCacheKey, Any] | A cache of resolved dependency values keyed by their provider and scope to ensure sub-dependencies are only evaluated once per request. |
Constructor
Signature
def SolvedDependency(
values: dict[str, Any],
errors: list[Any],
background_tasks: StarletteBackgroundTasks | None,
response: [Response](../../openapi/models/response.md?sid=fastapi_openapi_models_response),
dependency_cache: dict[DependencyCacheKey, Any]
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| values | dict[str, Any] | A dictionary mapping dependency names to their resolved values. |
| errors | list[Any] | A list of errors encountered during the dependency resolution process. |
| background_tasks | `StarletteBackgroundTasks | None` |
| response | [Response](../../openapi/models/response.md?sid=fastapi_openapi_models_response) | The response object associated with the dependency resolution. |
| dependency_cache | dict[DependencyCacheKey, Any] | A cache of resolved dependencies to prevent redundant computations. |
Signature
def SolvedDependency(
values: dict[str, Any],
errors: list[Any],
background_tasks: StarletteBackgroundTasks | None,
response: [Response](../../openapi/models/response.md?sid=fastapi_openapi_models_response),
dependency_cache: dict[DependencyCacheKey, Any]
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| values | dict[str, Any] | A mapping of dependency names to their resolved values. |
| errors | list[Any] | A list of errors encountered during the dependency resolution process. |
| background_tasks | `StarletteBackgroundTasks | None` |
| response | [Response](../../openapi/models/response.md?sid=fastapi_openapi_models_response) | The HTTP response object associated with the dependency execution context. |
| dependency_cache | dict[DependencyCacheKey, Any] | A cache used to store and reuse resolved dependencies across the request lifecycle. |