Skip to content

OpenAPI_Server

mattpolzin edited this page Jun 11, 2021 · 7 revisions

OpenAPI.Server

OpenAPI Spec "Server Object"

public struct Server: Equatable, CodableVendorExtendable 

See OpenAPI Server Object.

Inheritance

CodableVendorExtendable, Decodable, Encodable, Equatable

Initializers

init(url:description:variables:vendorExtensions:)

Create an OpenAPI Server Object.

public init(
            url: URL,
            description: String? = nil,
            variables: OrderedDictionary<String, Variable> = [:],
            vendorExtensions: [String: AnyCodable] = [:]
        ) 

init(urlTemplate:description:variables:vendorExtensions:)

Create an OpenAPI Server Object with a URL containing variables that can change depending on the context in which the API is invoked,

public init(
            urlTemplate: URLTemplate,
            description: String? = nil,
            variables: OrderedDictionary<String, Variable> = [:],
            vendorExtensions: [String: AnyCodable] = [:]
        ) 

init(from:)

public init(from decoder: Decoder) throws 

Properties

urlTemplate

OpenAPI Server URLs can have variable placeholders in them. The urlTemplate can be asked for a well-formed Foundation URL if all variables in it have been replaced by constant values.

public let urlTemplate: URLTemplate

description

public let description: String?

variables

A map from the names of variables found in the urlTemplate to descriptions, allowed values, and defaults.

public let variables: OrderedDictionary<String, Variable>

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