diff --git a/Fervor/Item.swift b/Fervor/Item.swift index 53cb27d..cb761a3 100644 --- a/Fervor/Item.swift +++ b/Fervor/Item.swift @@ -10,8 +10,8 @@ import Foundation public struct Item: Decodable { public let id: FervorID public let feedID: FervorID - public let title: String - public let author: String + public let title: String? + public let author: String? public let published: Date? public let createdAt: Date? public let content: String? @@ -25,8 +25,8 @@ public struct Item: Decodable { self.id = try container.decode(FervorID.self, forKey: .id) self.feedID = try container.decode(FervorID.self, forKey: .feedID) - self.title = try container.decode(String.self, forKey: .title) - self.author = try container.decode(String.self, forKey: .author) + self.title = try container.decodeIfPresent(String.self, forKey: .title) + self.author = try container.decodeIfPresent(String.self, forKey: .author) self.published = try container.decodeIfPresent(Date.self, forKey: .published) self.createdAt = try container.decodeIfPresent(Date.self, forKey: .createdAt) self.content = try container.decodeIfPresent(String.self, forKey: .content)