Use swift Codable to decode JSON with values as keys
问题 I have a problem decoding a JSON structure which I cannot change to make it easier to decode (it's coming from firebase).. How do I decode the following JSON into objects? The problem is how to convert "7E7-M001". It's the name of a container which has drawers. The drawers name is also used as a key. { "7E7-M001" : { "Drawer1" : { "101" : { "Partnumber" : "F101" }, "102" : { "Partnumber" : "F121" } } }, "7E7-M002": { "Drawer1": { "201": { "Partnumber": "F201" }, "202": { "Partnumber": "F221"