I'm trying to decode following JSON to my codable object.
[
{
"Action": "CREDIT",
"Status": 1,
"TransactionDate": "2019-09-20T04:23:19.530137Z",
"Description": "test"
},
{
"Action": "CREDIT",
"Status": 1,
"TransactionDate": "2019-09-20T04:23:19.530137Z",
"Description": "test"
},
{
"Action": "CREDIT",
"Status": 1,
"TransactionDate": "2019-09-20T04:23:19.530137Z",
"Description": "test"
}
]
My codable classes be like..
struct UserWalletHistoryList: Codable {
var historyList: [UserWalletHistory]
}
struct UserWalletHistory: Codable{
var Action: String?
var Status: Int?
var TransactionDate: String?
var Description: String?
}
but it is not successful. I think it's because of the variable name historyList since there is no such key as historyList in the JSON. Then..., what's it supposed to be?