Skip to content

Commit 82fdfc1

Browse files
authored
Merge pull request contentful#326 from sjaindl/fix/contentful-embeddedContentCoding
Fix decoding error for embedded entry-hyperlinks
2 parents cfc14e3 + 878c231 commit 82fdfc1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Contentful/RichText.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ public class ResourceLinkInline: InlineNode {
405405
try super.init(from: decoder)
406406
}
407407

408+
public override func encode(to encoder: Encoder) throws {
409+
try super.encode(to: encoder)
410+
var container = encoder.container(keyedBy: NodeContentCodingKeys.self)
411+
try container.encode(data, forKey: .data)
412+
}
413+
408414
public override func resolveLinks(against includedEntries: [String: Entry], and includedAssets: [String: Asset]) {
409415
switch data.target {
410416
case .asset, .entry, .entryDecodable:

0 commit comments

Comments
 (0)