반응형
Codable
-
Swift JSON 디코딩하는데 타입이 여러 데이터 타입으로 들어온다면?앱 개발자 2023. 9. 5. 22:06
What if a field has multiple types? Here's a solution. Error Message: typeMismatch typeMismatch(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "keywordList", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "monthlyPcQcCnt", intValue: nil)], debugDescription: "Expected to decode String but found a number instead.", underlyingE..