diff --git a/Sources/JSONAPI/Document/DocumentDecodingError.swift b/Sources/JSONAPI/Document/DocumentDecodingError.swift index f9994cf..34ff222 100644 --- a/Sources/JSONAPI/Document/DocumentDecodingError.swift +++ b/Sources/JSONAPI/Document/DocumentDecodingError.swift @@ -33,10 +33,10 @@ public enum DocumentDecodingError: Swift.Error, Equatable { self = .primaryResourceMissing case .valueNotFound(let type, let context) where Location(context) == .data && type == UnkeyedDecodingContainer.self: self = .primaryResourcesMissing - case .typeMismatch(let type, let context) where Location(context) == .data && type is AbstractResourceObject.Type && context.debugDescription.hasSuffix("but found null instead."): - self = .primaryResourceMissing case .typeMismatch(let type, let context) where Location(context) == .data && type == UnkeyedDecodingContainer.self && context.debugDescription.hasSuffix("but found null instead."): self = .primaryResourcesMissing + case .typeMismatch(_, let context) where Location(context) == .data && context.debugDescription.hasSuffix("but found null instead."): + self = .primaryResourceMissing default: return nil }