OasHeader
OasHeader is an object representing the OpenAPI header object.
Properties
Property | Type | Description |
---|---|---|
oasType | 'header' | Static value representing the OpenAPI header type. |
description | string | undefined | Optional description of the header. |
required | boolean | undefined | Optional flag indicating whether the header is required. |
deprecated | boolean | undefined | Optional flag indicating whether the header is deprecated. |
schema | OasSchema | undefined | Optional schema for the header. |
content | Record<string, OasMediaType> | undefined | Optional map of media types for the header. |
examples | Record<string, OasExample> | undefined | Optional map of examples for the header. |
extensionFields | Record<string, unknown> | undefined | Optional map of custom fields defined by OpenAPI extensions. Keys are strings beginning with x- and values are of any valid JSON type. |
Methods
toSchema
Returns the header as a schema.
header.toSchema( mediaType = 'application/json' )
Parameters
Parameter | Type | Description |
---|---|---|
mediaType | string | The media type to convert to a schema. |
Return value
An OasSchema or OasRef object.
isRef
Returns false
indicating that the header is not a reference.
header.isRef()
Return value
false
resolve
Returns the header itself.
header.resolve()
Return value
The header itself.
resolveOnce
Returns the header itself.
header.resolveOnce()
Return value
The header itself.