diff --git a/Sources/CoreXLSX/Relationships.swift b/Sources/CoreXLSX/Relationships.swift index 99efa2fe..e3add651 100644 --- a/Sources/CoreXLSX/Relationships.swift +++ b/Sources/CoreXLSX/Relationships.swift @@ -130,13 +130,29 @@ public struct Relationship: Codable, Equatable { """ http://purl.oclc.org/ooxml/officeDocument/relationships/extendedProperties """ + case sheetMetadata = + """ + http://schemas.openxmlformats.org/officeDocument/2006/relationships/\ + sheetMetadata + """ + } + + enum CodingKeys: String, CodingKey { + case id + case rawType = "type" + case target } /// The identifier for this entity. public let id: String /// The type of this entity. - public let type: SchemaType + public var type: SchemaType? { SchemaType(rawValue: rawType) } + + /// The raw type string. + /// This is needed so that Relationship decodes when encountering type strings + /// that are missing SchemaType cases. + public let rawType: String /// The path to this entity in the `.xlsx` archive. public let target: String