OpenAPI Headers
A map of header names to Header Objects or References that define headers in Response Objects or Encoding Objects.
In this simplified example, the server returns three Header Objects with the names X-RateLimit-Remaining
, Last-Modified
, and Cache-Control
:
Header Object in OpenAPI
Describes a single header.
The name of a header is determined by the header’s key in a headers
map.
Header Object Fields
Field
Type
String
Required
Description
A description of the header. This may contain CommonMark syntax to provide a rich description.
Type
Boolean
Required
Description
Whether the header is required. Defaults to
.
Type
Boolean
Required
Description
Whether the header is deprecated. Defaults to
.
Type
Required
Description
A schema or reference to a schema that defines the type of the header. This is required unless
is defined.
Note: OpenAPI 3.0.x supports OpenAPI Reference Objects here as a value. OpenAPI 3.1.x uses the JSON Schema Referencing format.
Type
Map[string, Media Type Object]
Required
Description
A map of Media Type Objects that define the possible media types that can be used for the header. This is required unless
is defined.
Type
Required
Description
Any number of extension fields can be added to the header object to be used by tooling and vendors.
Last updated on