Skip to content

OpenAPI_Link

mattpolzin edited this page Feb 7, 2022 · 1 revision

OpenAPI.Link

OpenAPI Spec "Link Object"

public struct Link: Equatable, CodableVendorExtendable 

See OpenAPI Link Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable

Nested Type Aliases

Map

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

Initializers

init(operation:parameters:requestBody:description:server:vendorExtensions:)

public init(
            operation: Either<URL, String>,
            parameters: OrderedDictionary<String, Either<RuntimeExpression, AnyCodable>> = [:],
            requestBody: Either<RuntimeExpression, AnyCodable>? = nil,
            description: String? = nil,
            server: Server? = nil,
            vendorExtensions: [String: AnyCodable] = [:]
        ) 

init(operationId:parameters:requestBody:description:server:vendorExtensions:)

Create a Link by referring to an operationId of some Operation elsewhere in the same document.

public init(
            operationId: String,
            parameters: OrderedDictionary<String, Either<RuntimeExpression, AnyCodable>> = [:],
            requestBody: Either<RuntimeExpression, AnyCodable>? = nil,
            description: String? = nil,
            server: Server? = nil,
            vendorExtensions: [String: AnyCodable] = [:]
        ) 

init(operationRef:parameters:requestBody:description:server:vendorExtensions:)

Create a Link by referring to an operationRef pointing to an Operation either in the same document or elsewhere.

public init(
            operationRef: URL,
            parameters: OrderedDictionary<String, Either<RuntimeExpression, AnyCodable>> = [:],
            requestBody: Either<RuntimeExpression, AnyCodable>? = nil,
            description: String? = nil,
            server: Server? = nil,
            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>> 

operation

The OpenAPI operationReforoperationIdfield, depending on whether aURLof a remote or local Operation Object or aoperationId` (String) of an operation defined in the same document is given.

public let operation: Either<URL, String>

parameters

A map from parameter names to either runtime expressions that evaluate to values or constant values (AnyCodable).

public let parameters: OrderedDictionary<String, Either<RuntimeExpression, AnyCodable>>

See the docuemntation for the OpenAPI Link Object for more details.

Empty dictionaries will be omitted from encoding.

requestBody

A literal value or expression to use as a request body when calling the target operation.

public let requestBody: Either<RuntimeExpression, AnyCodable>?

description

public var description: String?

server

public let server: Server?

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

encode(to:)

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