add_non_field_param_to_dependency
Assigns a parameter name to a specific attribute of a Dependant object based on whether the type annotation matches known system types like Request, WebSocket, or Response. Returns True if a match is found and the state is updated, otherwise returns None.
def add_non_field_param_to_dependency(
param_name: str,
type_annotation: Any,
dependant: Dependant
) - > bool | null
Assigns a parameter name to a specific attribute on a Dependant object based on its type annotation. This is used to map special request-related types like Request, Response, or BackgroundTasks to the correct internal dependency handler.
Parameters
| Name | Type | Description |
|---|---|---|
| param_name | str | The name of the parameter as defined in the function signature. |
| type_annotation | Any | The type hint or class used to determine which specific dependency attribute should be populated. |
| dependant | Dependant | The dependency model object that will store the mapping for later injection. |
Returns
| Type | Description |
|---|---|
| `bool | null` |