diff --git a/Pachyderm/Sources/Pachyderm/Model/Hashtag.swift b/Pachyderm/Sources/Pachyderm/Model/Hashtag.swift index 184f5229..ff61dd36 100644 --- a/Pachyderm/Sources/Pachyderm/Model/Hashtag.swift +++ b/Pachyderm/Sources/Pachyderm/Model/Hashtag.swift @@ -34,6 +34,13 @@ public class Hashtag: Codable { self.history = try container.decodeIfPresent([History].self, forKey: .history) } + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(url.absoluteString, forKey: .url) + try container.encodeIfPresent(history, forKey: .history) + } + private enum CodingKeys: String, CodingKey { case name case url