Swagger::HeaderObject Class Reference

describes a single HTTP header More...

Inheritance diagram for Swagger::HeaderObject:
[legend]

## Public Member Functions

| constructor (hash oh, SwaggerSchema swagger)
| Constructor. More...
Public Member Functions inherited from Swagger::ObjectBase
| constructor ()
| Constructor.
| constructor (hash oh)
| Constructor. More...
| constructor (ObjectBase other)
| copy constructor
| initialize (hash oh)
| Initialize. More...
Public Member Functions inherited from Swagger::SchemaBase
| constructor (string objType, hash oh)
| Constructor. More...
| constructor (SchemaBase other)
| Copy constructor.

## Public Attributes

*string | collectionFormat
| Determines the format of the array if type array is used. More...
auto | defaultVal
| Declares the value of the header that the server will use if none is provided. More...
*string | desc
| A short description of the header.
*string | format
| The extending format for the previously mentioned `type`. See Data Type Formats for further details.
*SchemaObject | items
| Required if type is `"array"`. Describes the type of items in the array.
string | type
| Required. The type of the object. More...
Public Attributes inherited from Swagger::ObjectBase
hash | vendorExtensions
| Allows extensions to the Swagger Schema. More...
Public Attributes inherited from Swagger::SchemaBase
hash< string, bool > | enum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1. More...
*bool | exclusiveMax
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
*bool | exclusiveMin
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
*float | maximum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
*int | maxItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
*int | maxLength
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
*float | minimum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
*int | minItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
*int | minLength
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
*float | multipleOf
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
*string | pattern
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
*bool | uniqueItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.

## Static Private Member Functions

static | checkValueType (auto value, string type, *SchemaObject items, *string loc)
| validates default values

## Detailed Description

describes a single HTTP header

## Member Function Documentation

## constructor()

Swagger::HeaderObject::constructor | ( | hash | oh,
|  | SwaggerSchema | swagger
| ) |  |

Constructor.

Parameters

  oh | deserialized hash from the source schema description describing a single HTTP header
  swagger | the REST schema for resolving references

Exceptions

  INVALID-FIELD-TYPE | field has invalid type
  INVALID-FIELD-VALUE | field has invalid value
  REQUIRED-FIELD-MISSING | required field is missing

## Member Data Documentation

## collectionFormat

*string Swagger::HeaderObject::collectionFormat

Determines the format of the array if type array is used.

Possible values are:

- `"csv"`: comma separated values; ex: foo,bar
- `"ssv"`: space separated values; ex: foo bar
- `"tsv"`: tab separated values; ex: foo\tbar
- `"pipes"`: pipe separated values; ex: foo|bar

Default value is `"csv"`.

## defaultVal

auto Swagger::HeaderObject::defaultVal

Declares the value of the header that the server will use if none is provided.

(Note: "default" has no meaning for required headers.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for the header.

## type

string Swagger::HeaderObject::type

Required. The type of the object.

The value MUST be one of `"string"`, `"number"`, `"integer"`, `"boolean"`, or `"array"`.