Skip to content

OpenAPI_Example

mattpolzin edited this page Sep 28, 2020 · 8 revisions

OpenAPI.Example

OpenAPI Spec "Example Object"

public struct Example: Equatable, CodableVendorExtendable

See OpenAPI Example Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable, LocallyDereferenceable

Nested Type Aliases

Map

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

Initializers

init(summary:description:value:vendorExtensions:)

public init(summary: String? = nil, description: String? = nil, value: Either<URL, AnyCodable>, 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>>

summary

let summary: String?

description

let description: String?

value

Represents the OpenAPI externalValue as a URL or the OpenAPI value as AnyCodable

let value: Either<URL, AnyCodable>

vendorExtensions

Dictionary of vendor extensions.

let 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

dereferenced(in:)

Examples do not contain any references but for convenience they can be "dereferenced" to themselves.

public func dereferenced(in components: OpenAPI.Components) throws -> OpenAPI.Example
Types
Protocols
Global Functions
Extensions
Clone this wiki locally