Skip to main content

Encoding

This class represents an encoding object, providing details on how to serialize a single property in a request body. It specifies content type, headers, serialization style, and whether to explode or allow reserved characters.

Attributes

AttributeTypeDescription
contentTypestr = NoneThe content type of the encoding, which specifies the media type of the request body.
headersdict[str, Union["Header", [Reference](reference.md?sid=fastapi_openapi_models_reference)]] = NoneA dictionary of header objects or references, which defines the headers that are sent with the encoded data.
stylestr = NoneThe serialization style for the encoded data, which dictates how the data is formatted.
explodebool = NoneA boolean indicating whether to explode the encoded data, affecting how arrays and objects are serialized.
allowReservedbool = NoneA boolean indicating whether reserved characters are allowed in the encoded data, impacting URL encoding behavior.