JSON data is rarely flat and often contains nested objects.
Nested JSON data can be decoded in Swift using the Decodable
protocol and the JSONDecoder
class.
However, how you decode nested JSON objects depends on the final result you want to obtain.