Encoding
- class Encoding(d: dict[str, Any] = None, contentType: str = None, headers: dict[str, Header] = None, style: ParameterStyle = None, explode: bool = None, allowReserved: bool = None)
A single encoding definition applied to a single schema property.
Properties are correlated with multipart parts using the name parameter of
Content-Disposition: form-data, and withapplication/x-www-form-urlencodedusing the query string parameter names. In both cases, their order is implementation-defined.- property contentType: str | None
The Content-Type for encoding a specific property. The value is a comma-separated list, each element of which is either a specific media type (e.g.
image/png) or a wildcard media type (e.g.image/*). Default value depends on the property type as shown in the table below.
- property headers: dict[str, Header | Reference] | None
A map allowing additional information to be provided as headers. Content-Type is described separately and SHALL be ignored in this section. This field SHALL be ignored if the request body media type is not a multipart.
- property style: ParameterStyle | None
Describes how the parameter value will be serialized depending on the type of the parameter value.
- property explode: bool | None
When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this field has no effect. When style is “form”, the default value is true. For all other styles, the default value is false. Note that despite false being the default for deepObject, the combination of false with deepObject is undefined.
- property allowReserved: bool | None
When this is true, parameter values are serialized using reserved expansion, as defined by RFC6570, which allows RFC3986’s reserved character set, as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including % outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are not allowed in the query string ([, ], #), or have a special meaning in application/x-www-form-urlencoded (-, &, +). This field only applies to parameters with an in value of query. The default value is false. This field SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored.