Skip to content

OpenAPI_Header

mattpolzin edited this page Aug 21, 2023 · 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

public static var openAPIComponentsKey: String 

openAPIComponentsKeyPath

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

description

public let description: String?

required

public let required: Bool

deprecated

public let deprecated: Bool 

schemaOrContent

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

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

vendorExtensions

Dictionary of vendor extensions.

public var vendorExtensions: [String: AnyCodable]

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

Methods

_dereferenced(in:following:dereferencedFromComponentNamed:)

An internal-use method that facilitates reference cycle detection by tracking past references followed in the course of dereferencing.

public func _dereferenced(
        in components: OpenAPI.Components,
        following references: Set<AnyHashable>,
        dereferencedFromComponentNamed name: String?
    ) throws -> DereferencedHeader 

For all external-use, see dereferenced(in:) (provided by the LocallyDereferenceable protocol). All types that provide a _dereferenced(in:following:) implementation have a dereferenced(in:) implementation for free.

encode(to:)

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