Skip to content

Commit 391bca2

Browse files
committed
a few less controversial changes for starters
1 parent 8c15b78 commit 391bca2

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

Sources/JSONAPI/Error/GenericJSONAPIError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// `GenericJSONAPIError` can be used to specify whatever error
99
/// payload you expect to need to parse in responses and handle any
1010
/// other payload structure as `.unknownError`.
11-
public enum GenericJSONAPIError<ErrorPayload: Codable & Equatable>: JSONAPIError, CustomStringConvertible {
11+
public enum GenericJSONAPIError<ErrorPayload: Codable & Equatable & Sendable>: JSONAPIError, CustomStringConvertible {
1212
case unknownError
1313
case error(ErrorPayload)
1414

Sources/JSONAPI/Error/JSONAPIError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Mathew Polzin on 11/10/18.
66
//
77

8-
public protocol JSONAPIError: Swift.Error, Equatable, Codable {
8+
public protocol JSONAPIError: Swift.Error, Equatable, Codable, Sendable {
99
static var unknown: Self { get }
1010
}
1111

Sources/JSONAPI/JSONAPICodingError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
// Created by Mathew Polzin on 12/7/18.
66
//
77

8-
public enum JSONAPICodingError: Swift.Error {
8+
public enum JSONAPICodingError: Swift.Error, Sendable {
99
case typeMismatch(expected: String, found: String, path: [CodingKey])
1010
case quantityMismatch(expected: Quantity, path: [CodingKey])
1111
case illegalEncoding(String, path: [CodingKey])
1212
case illegalDecoding(String, path: [CodingKey])
1313
case missingOrMalformedMetadata(path: [CodingKey])
1414
case missingOrMalformedLinks(path: [CodingKey])
1515

16-
public enum Quantity: String, Equatable {
16+
public enum Quantity: String, Equatable, Sendable {
1717
case one
1818
case many
1919

Sources/JSONAPI/Resource/Id.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension String: RawIdType {}
3131
/// A type that can be used as the `MaybeRawId` for a `ResourceObject` that does not
3232
/// have an Id (most likely because it was created by a client and the server will be responsible
3333
/// for assigning it an Id).
34-
public struct Unidentified: MaybeRawId, CustomStringConvertible {
34+
public struct Unidentified: MaybeRawId, CustomStringConvertible, Sendable {
3535
public init() {}
3636

3737
public var description: String { return "Unidentified" }

Sources/JSONAPI/Resource/Poly+PrimaryResource.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import Poly
1515
/// disparate types under one roof for
1616
/// the purposes of JSON API compliant
1717
/// encoding or decoding.
18-
public typealias EncodableJSONPoly = Poly & EncodablePrimaryResource
18+
public typealias EncodableJSONPoly = Poly & EncodablePrimaryResource & Sendable
1919

2020
public typealias EncodablePolyWrapped = Encodable & Equatable
2121
public typealias CodablePolyWrapped = EncodablePolyWrapped & Decodable
2222

23-
extension Poly0: CodablePrimaryResource {
23+
extension Poly0: @retroactive Encodable, @retroactive Decodable {
2424
public init(from decoder: Decoder) throws {
2525
throw JSONAPICodingError.illegalDecoding("Attempted to decode Poly0, which should represent a thing that is not expected to be found in a document.", path: decoder.codingPath)
2626
}
@@ -30,6 +30,8 @@ extension Poly0: CodablePrimaryResource {
3030
}
3131
}
3232

33+
extension Poly0: CodablePrimaryResource {}
34+
3335
// MARK: - 1 type
3436
extension Poly1: EncodablePrimaryResource, OptionalEncodablePrimaryResource
3537
where A: EncodablePolyWrapped {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public struct ResourceObjectDecodingError: Swift.Error, Equatable {
1313

1414
static let entireObject = "entire object"
1515

16-
public enum Cause: Equatable {
16+
public enum Cause: Equatable, Sendable {
1717
case keyNotFound
1818
case valueNotFound
1919
case typeMismatch(expectedTypeName: String)
@@ -26,7 +26,7 @@ public struct ResourceObjectDecodingError: Swift.Error, Equatable {
2626
}
2727
}
2828

29-
public enum Location: String, Equatable {
29+
public enum Location: String, Equatable, Sendable {
3030
case attributes
3131
case relationships
3232
case relationshipType

0 commit comments

Comments
 (0)