Skip to content

Commit a6ffeab

Browse files
committed
See if this fixes latest linux swift versions.
1 parent 0226117 commit a6ffeab

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/JSONAPI/Resource/Resource Object/ResourceObjectDecodingError.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,16 @@ public struct ResourceObjectDecodingError: Swift.Error, Equatable {
117117
location = .type
118118
}
119119

120+
let subjectPath: [CodingKey]
121+
if location == .relationships && path.last?.stringValue == "data" {
122+
subjectPath = path.dropLast()
123+
} else {
124+
subjectPath = path
125+
}
126+
120127
return (
121128
location,
122-
name: path.last?.stringValue ?? "unnamed"
129+
name: subjectPath.last?.stringValue ?? "unnamed"
123130
)
124131
}
125132
}

0 commit comments

Comments
 (0)