Skip to main content

get_dependant

Constructs a Dependant object by analyzing the provided callable's signature and its dependencies, recursively building a dependency tree. It processes path parameters, body parameters, and other fields, and handles OAuth scopes and dependency scoping rules.

def get_dependant(
path: str,
call: Callable[..., Any],
name: str | None = null,
own_oauth_scopes: list[str] | None = null,
parent_oauth_scopes: list[str] | None = null,
use_cache: bool = True,
scope: Literal["function", "request"] | None = null
) - > Dependant

Analyzes a callable (function or method) and its parameters to construct a Dependant object, which represents a dependency in a web application framework. This function recursively processes sub-dependencies and extracts information about path parameters, body parameters, and security scopes.

Parameters

NameTypeDescription
pathstrThe URL path associated with the callable, used to identify path parameters.
callCallable[..., Any]The callable (function or method) for which to create the Dependant object.
name`strNone` = null
own_oauth_scopes`list[str]None` = null
parent_oauth_scopes`list[str]None` = null
use_cachebool = TrueA boolean indicating whether the result of this dependant should be cached.
scope`Literal["function", "request"]None` = null

Returns

TypeDescription
DependantA Dependant object containing metadata about the callable, its dependencies, and parameters.