我有一个这样的 JSON。
我需要使用 Swift 4 在我的 iOS 应用程序中创建一个相应的 Decodable 结构。
{
"cherry": {
"filling": "cherries and love",
"goodWithIceCream": true,
"madeBy": "my grandmother"
},
"odd": {
"filling": "rocks, I think?",
"goodWithIceCream": false,
"madeBy": "a child, maybe?"
},
"super-chocolate": {
"flavor": "german chocolate with chocolate shavings",
"forABirthday": false,
"madeBy": "the charming bakery up the street"
}
}
在制作可解码结构时需要帮助。如何提及未知键,如cherry
,odd
和super-chocolate
.