flask_restx_marshmallow.parameter
¤
parameters of flask_restx_marshmallow.
Parameters
¤
Parameters(
*,
location: Location
| Literal[
"query",
"header",
"formData",
"body",
"cookie",
"path",
]
| None = None,
**kwargs: Unpack[SchemaInitKwargs],
)
Bases: Schema
Base Parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Location
|
location of the parameters. Defaults to None. |
None
|
|
dict
|
other key word arguments. |
{}
|
Base Parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Location
|
location of the parameters. Defaults to None. |
None
|
|
dict
|
other key word arguments. |
{}
|
Source code in flask_restx_marshmallow/parameter.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
Meta
¤
Meta for Parameters.
__contains__
¤
__contains__(field: str) -> bool
Whether field in self.fields.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
field name |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
whether field in self.fields |
Source code in flask_restx_marshmallow/parameter.py
96 97 98 99 100 101 102 103 104 105 |
|
__or__
¤
__or__(other: Parameters) -> Parameters
Combine two schemas.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Self
|
other schema |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Parameters
|
combined schema |
Source code in flask_restx_marshmallow/parameter.py
157 158 159 160 161 162 163 164 165 166 167 168 |
|
__setitem__
¤
__setitem__(key: str, value: Field) -> None
Set item.
Source code in flask_restx_marshmallow/parameter.py
116 117 118 |
|
combine
¤
combine(other: Parameters) -> Parameters
Combine two schemas.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Self
|
other schema |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Parameters
|
combined schema |
Source code in flask_restx_marshmallow/parameter.py
144 145 146 147 148 149 150 151 152 153 154 155 |
|
copy_body_fields
¤
copy_body_fields() -> Parameters
Return a copy of this schema with only fields that location is body.
Source code in flask_restx_marshmallow/parameter.py
120 121 122 123 124 125 126 127 128 129 130 |
|
copy_form_fields
¤
copy_form_fields() -> Parameters
Return a copy of this schema with only fields that location is formdata.
Source code in flask_restx_marshmallow/parameter.py
132 133 134 135 136 137 138 139 140 141 142 |
|
field_locations
¤
field_locations() -> list[FieldLocations]
Get (field_name, location, is_multiple) for each non-body field.
Returns:
Type | Description |
---|---|
list[FieldLocations]
|
list[FieldLocations]: field name, location, is multiple |
Source code in flask_restx_marshmallow/parameter.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
items
¤
items() -> Iterable[tuple[str, dict]]
Make dict.
Yields:
Type | Description |
---|---|
Iterable[tuple[str, dict]]
|
tuple[str, dict]: field name and field dict |
Source code in flask_restx_marshmallow/parameter.py
107 108 109 110 111 112 113 114 |
|
locations
¤
locations() -> set[str]
Get locations.
Returns:
Type | Description |
---|---|
set[str]
|
set[str]: locations |
Source code in flask_restx_marshmallow/parameter.py
67 68 69 70 71 72 73 74 75 76 77 |
|