I am using JSONDecoder to convert JSON into Objects.
Here is the code. It usually works fine.
do{
print("Hi")
if Data != nil{
let model = try JSONDecoder().decode(Base.self, from: Data!)
}
}
catch{
print("Error:\(error)")
}
But I am getting below Error
Error:typeMismatch(Swift.Double, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "rod", intValue: nil), CodingKeys(stringValue: "nod", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "meta", intValue: nil), CodingKeys(stringValue: "label", intValue: nil)], debugDescription: "Expected to decode Double but found a string/data instead.", underlyingError: nil))
It used to work fine. Any help in resolving this would be appreciated