Skip to content

Commit 28745a0

Browse files
committed
Fixes decoder issue on preferences "activeProgressGuide" property
In app.bsky.actor.defs#bskyAppStatePref, the activeProgressGuide is spec'd as an object, not a string. Struct existed already replaced string with struct definition. Added public initializers.
1 parent b91e2a4 commit 28745a0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Sources/ATProtoKit/Models/Lexicons/app.bsky/Actor/AppBskyActorDefs.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ extension AppBskyLexicon.Actor {
14881488
public let type: String = "app.bsky.actor.defs#bskyAppStatePref"
14891489

14901490
/// An active progress guide. Optional.
1491-
public let activeProgressGuide: String?
1491+
public let activeProgressGuide: BskyAppProgressGuideDefinition?
14921492

14931493
/// An array of elements that the user will see. Optional.
14941494
///
@@ -1531,13 +1531,23 @@ extension AppBskyLexicon.Actor {
15311531
/// The progress guide itself.
15321532
///
15331533
/// - Important: Current maximum length is 100 characters.
1534-
public let guide: [BskyAppStatePreferencesDefinition]
1535-
1534+
public let guide: String
1535+
1536+
public init(from decoder: any Decoder) throws {
1537+
let container = try decoder.container(keyedBy: CodingKeys.self)
1538+
self.guide = try container.decode(String.self, forKey: .guide)
1539+
}
1540+
15361541
public func encode(to encoder: any Encoder) throws {
15371542
var container = encoder.container(keyedBy: CodingKeys.self)
15381543

15391544
try container.truncatedEncode(self.guide, forKey: .guide, upToArrayLength: 100)
15401545
}
1546+
1547+
enum CodingKeys: CodingKey {
1548+
case guide
1549+
}
1550+
15411551
}
15421552

15431553
/// A definition model for a NUX.

0 commit comments

Comments
 (0)