Skip to content

OpenAPI_Request

mattpolzin edited this page Sep 28, 2020 · 8 revisions

OpenAPI.Request

OpenAPI Spec "Request Body Object"

public struct Request: Equatable, CodableVendorExtendable

See OpenAPI Request Body Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable, LocallyDereferenceable

Initializers

init(description:content:required:vendorExtensions:)

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

var description: String?

content

var content: Content.Map

required

var required: Bool

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 DereferencedRequest if all references in the request can be found in the given Components Object.

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

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