Header
- class Header(d: dict[str, Any] = None, description: str = None, required: bool = None, deprecated: bool = None, style: ParameterStyle = None, explode: bool = None, schema: Schema | Reference = None, example: Any = None, examples: dict[str, Example] = None, content: dict[str, MediaType] = None)
Describes a single header for HTTP responses and for individual parts in multipart representations; see the relevant Response Object and Encoding Object documentation for restrictions on which headers can be described.
The Header Object follows the structure of the Parameter Object, including determining its serialization strategy based on whether schema or content is present, with the following changes:
nameMUST NOT be specified, it is given in the corresponding headers map.locationMUST NOT be specified, it is implicitly in header.All traits that are affected by the location MUST be applicable to a location of header (for example,
style). This means thatallowEmptyValueandallowReservedMUST NOT be used, andstyle, if used, MUST be limited to"simple".
- property description: str | None
A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.
- property required: bool | None
Determines whether this parameter is mandatory. If the parameter location is “path”, this field is REQUIRED and its value MUST be true. Otherwise, the field MAY be included and its default value is false.
- property deprecated: bool | None
Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false.
- property style: ParameterStyle | None
Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for “query” - “form”; for “path” - “simple”; for “header” - “simple”; for “cookie” - “form”.
- 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 example: Any | None
Example of the parameter’s potential value.