Skip to main content

add_param_to_fields

Adds a parameter field to the appropriate list within a Dependant object based on its parameter type (path, query, header, or cookie).

def add_param_to_fields(
field: ModelField,
dependant: Dependant
) - > None

Adds a parameter field to the appropriate list within a Dependant object based on its parameter type. This function categorizes and stores fields for later processing, such as validation or dependency injection.

Parameters

NameTypeDescription
fieldModelFieldThe field to be added, containing information about the parameter, including its type (e.g., path, query, header, cookie).
dependantDependantThe Dependant object to which the field will be appended. This object stores categorized lists of parameters.

Returns

TypeDescription
NoneThis function does not return any value; it modifies the dependant object in place.