From a368bc4365111ffe09536e0bcf9a3ed890adef82 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 12 Jan 2022 21:51:35 -0500 Subject: [PATCH] Fix Fervor item schema --- Fervor/Item.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)