mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
Move PolyWrapped out of Poly and into JSONAPI.
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
"repositoryURL": "https://github.com/mattpolzin/Poly.git",
|
||||
"state": {
|
||||
"branch": "master",
|
||||
"revision": "92d889c2cdc027bb94814187e84d34783ae159ae",
|
||||
"revision": "b2a2198ada7d826903411678e19a6d953f52dcbd",
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import Poly
|
||||
/// encoding or decoding.
|
||||
public typealias JSONPoly = Poly & PrimaryResource
|
||||
|
||||
public typealias PolyWrapped = Codable & Equatable
|
||||
|
||||
extension Poly0: PrimaryResource {
|
||||
public init(from decoder: Decoder) throws {
|
||||
throw JSONAPIEncodingError.illegalDecoding("Attempted to decode Poly0, which should represent a thing that is not expected to be found in a document.")
|
||||
@@ -28,7 +30,7 @@ extension Poly0: PrimaryResource {
|
||||
}
|
||||
|
||||
// MARK: - 1 type
|
||||
extension Poly1: PrimaryResource, MaybePrimaryResource where A: Codable & Equatable {}
|
||||
extension Poly1: PrimaryResource, MaybePrimaryResource where A: PolyWrapped {}
|
||||
|
||||
// MARK: - 2 types
|
||||
extension Poly2: PrimaryResource, MaybePrimaryResource where A: PolyWrapped, B: PolyWrapped {}
|
||||
|
||||
Reference in New Issue
Block a user