CodeSquared docs

OasHeader

OasHeader is an object representing the OpenAPI header object.

Properties

PropertyTypeDescription
oasType'header'Static value representing the OpenAPI header type.
descriptionstring | undefinedOptional description of the header.
requiredboolean | undefinedOptional flag indicating whether the header is required.
deprecatedboolean | undefinedOptional flag indicating whether the header is deprecated.
schemaOasSchema | undefinedOptional schema for the header.
contentRecord<string, OasMediaType> | undefinedOptional map of media types for the header.
examplesRecord<string, OasExample> | undefinedOptional map of examples for the header.
extensionFieldsRecord<string, unknown> | undefinedOptional 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
ParameterTypeDescription
mediaTypestringThe 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.