Skip to content

Commit 86de52f

Browse files
committed
ditch centos which had non-test-related error. fix type mismatch heuristic.
1 parent d941660 commit 86de52f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
- swift:5.5-amazonlinux2
3636
- swift:5.6-bionic
3737
- swift:5.6-focal
38-
- swift:5.6-centos7
3938
- swift:5.6-amazonlinux2
4039
container: ${{ matrix.image }}
4140
steps:

Sources/JSONAPI/Document/DocumentDecodingError.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public enum DocumentDecodingError: Swift.Error, Equatable {
3333
self = .primaryResourceMissing
3434
case .valueNotFound(let type, let context) where Location(context) == .data && type == UnkeyedDecodingContainer.self:
3535
self = .primaryResourcesMissing
36-
case .typeMismatch(_, let context) where context.debugDescription.hasSuffix("but found null instead."):
36+
case .typeMismatch(let type, let context) where Location(context) == .data && type is AbstractResourceObject.Type && context.debugDescription.hasSuffix("but found null instead."):
37+
self = .primaryResourceMissing
38+
case .typeMismatch(let type, let context) where Location(context) == .data && type == UnkeyedDecodingContainer.self && context.debugDescription.hasSuffix("but found null instead."):
3739
self = .primaryResourcesMissing
3840
default:
3941
return nil

0 commit comments

Comments
 (0)