J
Size: a a a
J
J
J
АЧ
AS
АЧ
АЧ
АЧ
AS
АЧ
import Foundation
import PlaygroundSupport
struct HZ: Codable {
let success: Bool
let data: HzData
}
struct HzData: Codable {
let DLM: [String : DlmContent]
}
struct DlmContent: Codable {
let price: Int
let airline: String
let flight_number: Int
let departure_at: String
let return_at: String
let expires_at: String
}
let json = """
{
"success": true,
"data": {
"DLM": {
"0": {
"price": 15853,
"airline": "ZF",
"flight_number": 401,
"departure_at": "2021-08-25T03:15:00+03:00",
"return_at": "2021-09-08T09:00:00+03:00",
"expires_at": "2021-08-05T10:15:16Z"
},
"1": {
"price": 14181,
"airline": "DP",
"flight_number": 204,
"departure_at": "2021-08-04T06:50:00+03:00",
"return_at": "2021-08-06T14:50:00+03:00",
"expires_at": "2021-08-05T10:15:16Z"
},
"2": {
"price": 18724,
"airline": "N4",
"flight_number": 148,
"departure_at": "2021-10-15T21:00:00+03:00",
"return_at": "2021-10-23T20:50:00+03:00",
"expires_at": "2021-08-05T10:15:16Z"
},
"3": {
"price": 18724,
"airline": "N4",
"flight_number": 148,
"departure_at": "2021-10-15T21:00:00+03:00",
"return_at": "2021-10-23T20:50:00+03:00",
"expires_at": "2021-08-05T10:15:16Z"
}
}
},
"currency": "rub"
}
"""
if
let jsonData = json.data(using: .utf8) {
let jsonObj =
try? JSONDecoder().decode(HZ.
self, from: jsonData)
print(jsonObj?.data.DLM.keys)
}
AS
АЧ
AS
АЧ
AS
AS
АЧ
АЧ
AS