diff --git a/Sources/Core/Domain/Marketplace.swift b/Sources/Core/Domain/Marketplace.swift index b4f929e..52d1b6f 100644 --- a/Sources/Core/Domain/Marketplace.swift +++ b/Sources/Core/Domain/Marketplace.swift @@ -37,7 +37,11 @@ struct PublicDeckOwner: Codable, Hashable, Sendable { let displayName: String let verifiedMana: Bool let verifiedCommunity: Bool - let pseudonym: String? + /// Flag: Autor tritt pseudonym auf (Anzeigename verbergen). + /// Server-Schema ist `boolean NOT NULL DEFAULT false`. War in v0.8.x + /// fälschlich als `String?` (Anzeige-Pseudonym) interpretiert — + /// führte zu Decoder-typeMismatch beim Öffnen eines Marketplace-Decks. + let pseudonym: Bool enum CodingKeys: String, CodingKey { case slug @@ -53,7 +57,7 @@ struct PublicDeckOwner: Codable, Hashable, Sendable { displayName = try c.decode(String.self, forKey: .displayName) verifiedMana = try c.decode(Bool.self, forKey: .verifiedMana) verifiedCommunity = try c.decode(Bool.self, forKey: .verifiedCommunity) - pseudonym = try c.decodeIfPresent(String.self, forKey: .pseudonym) + pseudonym = (try? c.decode(Bool.self, forKey: .pseudonym)) ?? false } } diff --git a/Tests/UnitTests/MarketplaceDecodingTests.swift b/Tests/UnitTests/MarketplaceDecodingTests.swift index c1d7a80..c86904c 100644 --- a/Tests/UnitTests/MarketplaceDecodingTests.swift +++ b/Tests/UnitTests/MarketplaceDecodingTests.swift @@ -31,7 +31,7 @@ struct MarketplaceDecodingTests { "display_name": "mana-Kuratoren", "verified_mana": true, "verified_community": false, - "pseudonym": null + "pseudonym": false } } """.data(using: .utf8)! diff --git a/project.yml b/project.yml index 2a39639..43a5fe4 100644 --- a/project.yml +++ b/project.yml @@ -55,7 +55,7 @@ targets: path: Sources/Resources/Info.plist properties: CFBundleShortVersionString: "0.1.0" - CFBundleVersion: "3" + CFBundleVersion: "4" CFBundleDevelopmentRegion: de CFBundleDisplayName: Cardecky LSApplicationCategoryType: "public.app-category.education" @@ -111,7 +111,7 @@ targets: properties: CFBundleDisplayName: Als Karte speichern CFBundleShortVersionString: "0.1.0" - CFBundleVersion: "3" + CFBundleVersion: "4" NSExtension: NSExtensionPointIdentifier: com.apple.share-services NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController @@ -144,7 +144,7 @@ targets: properties: CFBundleDisplayName: Cardecky Widget CFBundleShortVersionString: "0.1.0" - CFBundleVersion: "3" + CFBundleVersion: "4" NSExtension: NSExtensionPointIdentifier: com.apple.widgetkit-extension entitlements: