tornado-openapi
  • Overview
  • Quick Start
  • Reference
    • OpenApiConfigurator
    • OpenApiConfiguration
    • OpenApiHandler
    • decorators.*
    • objects.*
      • DescriptionObject
      • Callback
      • Components
      • Contact
      • Discriminator
      • Encoding
      • Example
      • ExternalDocumentation
      • Header
      • Info
      • License
      • Link
      • MediaType
      • OAuthFlow
      • OAuthFlows
      • OpenAPI
      • Operation
      • Parameter
      • ParameterLocation
      • ParameterStyle
      • PathItem
      • Paths
      • Reference
      • RequestBody
      • Response
      • Responses
      • Schema
      • SecurityRequirement
      • SecurityScheme
      • Server
      • ServerVariable
      • Tag
      • Xml
  • MIT License
  • Contact
tornado-openapi
  • Reference
  • objects
  • Header

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:

  • name MUST NOT be specified, it is given in the corresponding headers map.

  • location MUST 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 that allowEmptyValue and allowReserved MUST NOT be used, and style, 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 schema: Schema | Reference | None

The schema defining the type used for the parameter.

property example: Any | None

Example of the parameter’s potential value.

property examples: dict[str, Example] | None

Examples of the parameter’s potential value.

property content: dict[str, MediaType] | None

A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.

Previous Next

© Copyright Shaun Wilson.

Built with Sphinx using a theme provided by Read the Docs.