When calling to this specific API, one of the variables changes based on the results.
Example:
{
"map": {
"1945206": {
"installBaseNUMB": 0,
"serialNumber": "KB1",
...
}
}
}
1945206 will change to another number and I don't know how to properly decode this.
My Codable struct is as follows:
struct Map: Codable {
let the1945206: The1945206?
enum CodingKeys: String, CodingKey {
case the1945206 = "1945206"
}
}
struct The1945206: Codable {
let installBaseNUMB: Int?
let serialNumber, woStatus: String?
let workOrderNumber: Int?
let woNotes: [String]?
let woParts: [WoPart]?
}
If 1945206 changes to another value, it breaks and won't show any results. How do I use a dynamic variable in decoding the data?