Skip to content

Commit 52de648

Browse files
committed
fix swift 6 errors
1 parent e23be91 commit 52de648

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Sources/JSONAPI/Error/BasicJSONAPIError.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
/// Most of the JSON:API Spec defined Error fields.
9-
public struct BasicJSONAPIErrorPayload<IdType: Codable & Equatable>: Codable, Equatable, ErrorDictType, CustomStringConvertible {
9+
public struct BasicJSONAPIErrorPayload<IdType: Codable & Equatable & Sendable>: Codable, Equatable, ErrorDictType, CustomStringConvertible, Sendable {
1010
/// a unique identifier for this particular occurrence of the problem
1111
public let id: IdType?
1212

@@ -39,7 +39,7 @@ public struct BasicJSONAPIErrorPayload<IdType: Codable & Equatable>: Codable, Eq
3939
self.source = source
4040
}
4141

42-
public struct Source: Codable, Equatable {
42+
public struct Source: Codable, Equatable, Sendable {
4343
/// a JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].
4444
public let pointer: String?
4545
/// which URI query parameter caused the error
@@ -100,4 +100,4 @@ public struct BasicJSONAPIErrorPayload<IdType: Codable & Equatable>: Codable, Eq
100100
/// with non-nil values in a flattened way. There will be no `source` key
101101
/// but there will be `pointer` and `parameter` keys (if those values
102102
/// are non-nil).
103-
public typealias BasicJSONAPIError<IdType: Codable & Equatable> = GenericJSONAPIError<BasicJSONAPIErrorPayload<IdType>>
103+
public typealias BasicJSONAPIError<IdType: Codable & Equatable & Sendable> = GenericJSONAPIError<BasicJSONAPIErrorPayload<IdType>>

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/JSONAPICodingError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public enum JSONAPICodingError: Swift.Error {
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/Poly+PrimaryResource.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public typealias EncodableJSONPoly = Poly & EncodablePrimaryResource
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)