Skip to content

Commit

Permalink
Fix decoding error support for newer MacOS Swift versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Apr 30, 2024
1 parent 457ac3d commit 6f8e133
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/JSONAPI/Document/DocumentDecodingError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +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 .valueNotFound(let type, let context) where Location(context) == .data && type is _ArrayType.Type && context.debugDescription.hasSuffix("found null value instead"):
self = .primaryResourcesMissing
case .valueNotFound(_, let context) where Location(context) == .data && context.debugDescription.hasSuffix("found null value instead"):
self = .primaryResourceMissing
case .typeMismatch(let type, let context) where Location(context) == .data && type is _ArrayType.Type && context.debugDescription.hasSuffix("but found null instead."):
self = .primaryResourcesMissing
case .typeMismatch(_, let context) where Location(context) == .data && context.debugDescription.hasSuffix("but found null instead."):
Expand Down

0 comments on commit 6f8e133

Please sign in to comment.