Replaced the Tuple schema for the OpenAPI specification document in the library target with per-type key-name payloads.

This commit is contained in:
2026-07-26 02:06:40 +02:00
parent c1c6f147f6
commit 64117bea5c
8 changed files with 102 additions and 67 deletions
@@ -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 {}