Skip to main content

add_param_to_fields

Categorizes and appends a model field to the appropriate parameter list of a Dependant object based on its defined parameter type (path, query, header, or cookie).

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

Categorizes and adds a model field to the appropriate parameter list of a dependency based on its location type (path, query, header, or cookie).

Parameters

NameTypeDescription
fieldModelFieldThe model field representing a non-body parameter to be categorized.
dependantDependantThe dependency container where the field will be appended to the specific parameter collection.

Returns

TypeDescription
NoneNothing; the dependant object is modified in-place.