You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Codec("Id")
var id: String? = nil
@Codec("Value")
var value: String? = nil
@Codec("Children")
var child: [LocationModel]? = nil
}
Test:
let jsonString2 =
"[{\"Value\":null,\"Label\":\"State/Province\",\"Id\":\"a0Mp0000007ANEoEAO\",\"Children\":[{\"Value\":\"Bangkok\",\"Label\":\"City\",\"Id\":\"a0Mp0000007ANe7EAG\",\"Children\":[{\"Value\":\"Bang Kapi\",\"Label\":\"District\",\"Id\":\"a0Mp0000007ANeCEAW\",\"Children\":null}]}]}]".data(using: .utf8)!
let decoder = JSONDecoder()
let model = try! decoder.decode([LocationModel].self, from: jsonString2)
logInfo("json = \(model.toJSONString())")
The text was updated successfully, but these errors were encountered:
import CodableWrapper
struct LocationModel: Codable {
}
Test:
The text was updated successfully, but these errors were encountered: