Skip to content

OpenAPI_Example

mattpolzin edited this page Aug 21, 2023 · 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

public static var openAPIComponentsKey: String 

openAPIComponentsKeyPath

public static var openAPIComponentsKeyPath: KeyPath<OpenAPI.Components, OpenAPI.ComponentDictionary<Self>> 

summary

public let summary: String?

description

public let description: String?

value

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

public let value: Either<URL, AnyCodable>

vendorExtensions

Dictionary of vendor extensions.

public 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:following:dereferencedFromComponentNamed:)

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

public func _dereferenced(
        in components: OpenAPI.Components,
        following references: Set<AnyHashable>,
        dereferencedFromComponentNamed name: String?
    ) throws -> OpenAPI.Example
Types
Protocols
Global Functions
Extensions
Clone this wiki locally