Skip to content

OpenAPI_Header

mattpolzin edited this page Sep 28, 2020 · 9 revisions

OpenAPI.Header

OpenAPI Spec "Header Object"

public struct Header: Equatable, CodableVendorExtendable

See OpenAPI Header Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable, LocallyDereferenceable

Nested Type Aliases

SchemaContext

public typealias SchemaContext = Parameter.SchemaContext

Map

public typealias Map = OrderedDictionary<String, Either<JSONReference<OpenAPI.Header>, OpenAPI.Header>>

Initializers

init(schemaOrContent:description:required:deprecated:vendorExtensions:)

public init(schemaOrContent: Either<SchemaContext, OpenAPI.Content.Map>, description: String? = nil, required: Bool = false, deprecated: Bool = false, vendorExtensions: [String: AnyCodable] = [:])

init(schema:description:required:deprecated:vendorExtensions:)

public init(schema: SchemaContext, description: String? = nil, required: Bool = false, deprecated: Bool = false, vendorExtensions: [String: AnyCodable] = [:])

init(schema:description:required:deprecated:vendorExtensions:)

public init(schema: JSONSchema, description: String? = nil, required: Bool = false, deprecated: Bool = false, vendorExtensions: [String: AnyCodable] = [:])

init(schemaReference:description:required:deprecated:vendorExtensions:)

public init(schemaReference: JSONReference<JSONSchema>, description: String? = nil, required: Bool = false, deprecated: Bool = false, vendorExtensions: [String: AnyCodable] = [:])

init(content:description:required:deprecated:vendorExtensions:)

public init(content: OpenAPI.Content.Map, description: String? = nil, required: Bool = false, deprecated: Bool = false, vendorExtensions: [String: AnyCodable] = [:])

init(from:)

public init(from decoder: Decoder) throws

Properties

openAPIComponentsKey

var openAPIComponentsKey: String

openAPIComponentsKeyPath

var openAPIComponentsKeyPath: KeyPath<OpenAPI.Components, OpenAPI.ComponentDictionary<Self>>

description

let description: String?

required

let required: Bool

deprecated

let deprecated: Bool

schemaOrContent

OpenAPI Spec "schema" or "content", which are mutually exclusive.

let schemaOrContent: Either<SchemaContext, OpenAPI.Content.Map>

vendorExtensions

Dictionary of vendor extensions.

var vendorExtensions: [String: AnyCodable]

These should be of the form: [ "x-extensionKey": <anything>] where the values are anything codable.

Methods

dereferenced(in:)

Create a DereferencedHeader if all references in the header can be found in the given Components Object.

public func dereferenced(in components: OpenAPI.Components) throws -> DereferencedHeader

Throws

ReferenceError.cannotLookupRemoteReference or ReferenceError.missingOnLookup(name:key:) depending on whether an unresolvable reference points to another file or just points to a component in the same file that cannot be found in the Components Object.

encode(to:)

public func encode(to encoder: Encoder) throws
Types
Protocols
Global Functions
Extensions
Clone this wiki locally