File tree Expand file tree Collapse file tree 3 files changed +2
-13
lines changed Expand file tree Collapse file tree 3 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ extension HomogeneousArrayResponse: Decodable {
147
147
"""
148
148
throw SDKError . unparseableJSON ( data: nil , errorMessage: errorMessage)
149
149
}
150
- let entryDecodable = try entryDecodableType . popEntryDecodable ( from : & entriesJSONContainer )
150
+ let entryDecodable = try entriesJSONContainer . decode ( entryDecodableType )
151
151
entries. append ( entryDecodable)
152
152
}
153
153
@@ -331,7 +331,7 @@ extension KeyedDecodingContainer {
331
331
// For includes, if the type of this entry isn't defined by the user, we skip serialization.
332
332
if let type = contentTypes [ contentTypeInfo. id] {
333
333
do {
334
- let entryModellable = try type . popEntryDecodable ( from : & entriesJSONContainer )
334
+ let entryModellable = try entriesJSONContainer . decode ( type )
335
335
entries. append ( entryModellable)
336
336
} catch {
337
337
if throwIfNotPresent {
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ public extension Date {
53
53
let dateString = try container. decode ( String . self)
54
54
55
55
let timeZone = decoder. timeZone
56
- let formatter = Date . iso8601Formatter ( timeZone: timeZone)
57
56
58
57
for format in Date . supportedFormats {
59
58
let formatter = DateFormatterCache . shared. get ( format, timeZone: timeZone)
Original file line number Diff line number Diff line change @@ -79,16 +79,6 @@ public extension JSONDecoder {
79
79
}
80
80
}
81
81
82
- public extension Decodable where Self: EntryDecodable {
83
- // This is a magic workaround for the fact that dynamic metatypes cannot be passed into
84
- // initializers such as UnkeyedDecodingContainer.decode(Decodable.Type), yet static methods CAN
85
- // be called on metatypes. (Visitor pattern)
86
- static func popEntryDecodable( from container: inout UnkeyedDecodingContainer ) throws -> Self {
87
- let entryDecodable = try container. decode ( self )
88
- return entryDecodable
89
- }
90
- }
91
-
92
82
extension Decodable where Self: AssetDecodable {
93
83
static func popAssetDecodable( from container: inout UnkeyedDecodingContainer ) throws -> Self {
94
84
let assetDecodable = try container. decode ( self )
You can’t perform that action at this time.
0 commit comments