File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
Modules/Sources/Networking/Model/Product Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import NetworkingCore
2222/// }
2323/// ]
2424///
25- internal struct ProductMetadataExtractor : Decodable {
25+ internal struct ProductMetadataExtractor {
2626
2727 private typealias AnyDictionary = [ String : Any ? ]
2828
@@ -36,23 +36,6 @@ internal struct ProductMetadataExtractor: Decodable {
3636 self . metadata = metadata
3737 }
3838
39- /// Decode main metadata supporting both array and object formats.
40- /// This expects to decode the raw metadata array/object, not a JSON object with a meta_data field.
41- ///
42- init ( from decoder: Decoder ) throws {
43- let container = try decoder. singleValueContainer ( )
44-
45- // Try to decode as array first (standard format)
46- if let metaDataArray = try ? container. decode ( [ MetaData ] . self) {
47- self . metadata = metaDataArray
48- } else if let metaDataDict = try ? container. decode ( [ String : MetaData ] . self) {
49- // Try to decode as object keyed by index strings
50- self . metadata = Array ( metaDataDict. values)
51- } else {
52- self . metadata = [ ]
53- }
54- }
55-
5639 /// Searches product metadata for subscription data and converts it to a `ProductSubscription` if possible.
5740 ///
5841 internal func extractProductSubscription( ) throws -> ProductSubscription ? {
You can’t perform that action at this time.
0 commit comments