diff --git a/Packages/Models/Sources/Models/Status.swift b/Packages/Models/Sources/Models/Status.swift index aa203a8d..514ce828 100644 --- a/Packages/Models/Sources/Models/Status.swift +++ b/Packages/Models/Sources/Models/Status.swift @@ -8,6 +8,15 @@ public struct Application: Codable, Identifiable { public let website: URL? } +extension Application { + public init(from decoder: Decoder) throws { + let values = try decoder.container(keyedBy: CodingKeys.self) + + name = try values.decodeIfPresent(String.self, forKey: .name) ?? "" + website = try? values.decodeIfPresent(URL.self, forKey: .website) + } +} + public enum Visibility: String, Codable, CaseIterable { case pub = "public" case unlisted