Replaced the Tuple schema for the OpenAPI specification document in the library target with per-type key-name payloads.
This commit is contained in:
@@ -27,6 +27,6 @@ protocol KeyNameModel: Sendable, Hashable {
|
||||
|
||||
/// Initializes this model from a given payload.
|
||||
/// - Parameter payload: A payload that contains the values for the model.
|
||||
init(_ payload: Components.Schemas.Tuple)
|
||||
init(_ payload: some KeyNamePayload)
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// ===----------------------------------------------------------------------===
|
||||
//
|
||||
// This source file is part of the Amiibo Service open source project
|
||||
//
|
||||
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||
// Licensed under Apache license v2.0
|
||||
//
|
||||
// See LICENSE for license information
|
||||
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// ===----------------------------------------------------------------------===
|
||||
|
||||
/// A protocol that unifies the generated payload types containing a `key` and `name` pair.
|
||||
protocol KeyNamePayload {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
/// A hexadecimal key that uniquely identifies this payload.
|
||||
var key: String { get }
|
||||
|
||||
/// A display name for this payload.
|
||||
var name: String { get }
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Conformances
|
||||
|
||||
extension Components.Schemas.AmiiboSeries: KeyNamePayload {}
|
||||
extension Components.Schemas.AmiiboType: KeyNamePayload {}
|
||||
extension Components.Schemas.GameCharacter: KeyNamePayload {}
|
||||
extension Components.Schemas.GameSeries: KeyNamePayload {}
|
||||
Reference in New Issue
Block a user