Skip to content

OpenAPI_SecurityScheme

mattpolzin edited this page Aug 21, 2023 · 7 revisions

OpenAPI.SecurityScheme

OpenAPI Spec "Security Scheme Object"

public struct SecurityScheme: Equatable, CodableVendorExtendable 

See OpenAPI Security Scheme Object.

Inheritance

CodableVendorExtendable, ComponentDictionaryLocatable, Decodable, Encodable, Equatable, LocallyDereferenceable

Initializers

init(type:description:vendorExtensions:)

public init(
            type: SecurityType,
            description: String? = 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>> 

type

public var type: SecurityType

description

public var description: String?

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

apiKey(name:location:description:)

public static func apiKey(name: String, location: Location, description: String? = nil) -> SecurityScheme 

http(scheme:bearerFormat:description:)

public static func http(scheme: String, bearerFormat: String? = nil, description: String? = nil) -> SecurityScheme 

oauth2(flows:description:)

public static func oauth2(flows: OAuthFlows, description: String? = nil) -> SecurityScheme 

openIdConnect(url:description:)

public static func openIdConnect(url: URL, description: String? = nil) -> SecurityScheme 

encode(to:)

public func encode(to encoder: Encoder) throws 

_dereferenced(in:following:dereferencedFromComponentNamed:)

Security Schemes 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.SecurityScheme 
Types
Protocols
Global Functions
Extensions
Clone this wiki locally