@@ -13,7 +13,7 @@ public typealias Tag = String
13
13
14
14
public struct UserDetail {
15
15
public var bio : String ?
16
- public var bioLinks : [ String ]
16
+ public var bioLinks : SafeDecodingArray < URL >
17
17
public let currentAvatarImageUrl : String ?
18
18
public let currentAvatarThumbnailImageUrl : String ?
19
19
public let displayName : String
@@ -38,7 +38,10 @@ extension UserDetail: Codable {
38
38
public init ( from decoder: any Decoder ) throws {
39
39
let container = try decoder. container ( keyedBy: CodingKeys . self)
40
40
bio = try container. decodeIfPresent ( String . self, forKey: . bio)
41
- bioLinks = try container. decodeIfPresent ( [ String ] . self, forKey: . bioLinks) ?? [ ]
41
+ bioLinks = try container. decodeIfPresent (
42
+ SafeDecodingArray< URL> . self ,
43
+ forKey: . bioLinks
44
+ ) ?? SafeDecodingArray ( elements: [ ] )
42
45
currentAvatarImageUrl = try container. decodeIfPresent ( String . self, forKey: . currentAvatarImageUrl)
43
46
currentAvatarThumbnailImageUrl = try container. decodeIfPresent (
44
47
String . self,
@@ -72,7 +75,7 @@ public struct EditableUserInfo: Codable, Hashable {
72
75
73
76
public init ( detail: any ProfileDetailRepresentable ) {
74
77
self . bio = detail. bio ?? " "
75
- self . bioLinks = [ ]
78
+ self . bioLinks = detail . bioLinks . elements
76
79
self . status = detail. status
77
80
self . statusDescription = detail. statusDescription
78
81
self . tags = detail. tags
0 commit comments