How do you use tests to drive writing logic to decode JSON data into a model object?
By feeding the tests a predefined JSON input and verify the decoding produces a value matching it.
Swift’s Decodable protocol offers a type-safe way to describe how to transform Data, such as a JSON in the body of an HTTP response, into an object or value type. With Decodable doing most of the heavy lifting, is it worth using tests to drive the implementation of JSON decoding logic?
When the JSON object has keys and values with names and types that map directly to Swift, there is no real logic you need ...