Skip to content

OpenAPI_Parameter

mattpolzin edited this page Oct 1, 2020 · 8 revisions

OpenAPI.Parameter

OpenAPI Spec "Parameter Object"

public struct Parameter: Equatable, CodableVendorExtendable

See OpenAPI Parameter Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable, LocallyDereferenceable

Nested Type Aliases

Array

An array of parameters that are Either Parameters or references to parameters.

public typealias Array = [Either<JSONReference<OpenAPI.Parameter>, OpenAPI.Parameter>]

Initializers

init(name:context:schemaOrContent:description:deprecated:vendorExtensions:)

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

init(name:context:schema:description:deprecated:vendorExtensions:)

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

init(name:context:schema:description:deprecated:vendorExtensions:)

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

init(name:context:schemaReference:description:deprecated:vendorExtensions:)

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

init(name:context:content:description:deprecated:vendorExtensions:)

public init(name: String, context: Context, content: OpenAPI.Content.Map, description: String? = nil, 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>>

name

var name: String

context

OpenAPI Spec "in" property determines the Context.

var context: Context

description

var description: String?

deprecated

var deprecated: Bool

schemaOrContent

OpenAPI Spec "content" or "schema" properties.

var 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.

required

var required: Bool

location

var location: Context.Location

Methods

dereferenced(in:)

Create a DereferencedParameter if all references in the parameter can be found in the given Components Object.

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

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