Does it produce Codable?
Yes. Every generated struct is declared as struct Name: Codable, which is Swift's typealias for Decodable & Encodable. That means you can JSONDecoder().decode(Root.self, from: data) to read and JSONEncoder().encode(root) to write — both directions for free, no extra protocols or boilerplate. If you only need decoding (the common case for API consumers), narrow the conformance to Decodable; for write-only DTOs use Encodable.
How are nested JSON keys handled with CodingKeys?
For JSON keys that are valid Swift identifiers and match the Swift property name, no CodingKeys enum is needed — Codable maps them automatically. For snake_case JSON keys (e.g. zip_code) you have two options: (1) set decoder.keyDecodingStrategy = .convertFromSnakeCase to remap the entire payload to camelCase Swift properties, or (2) declare a private enum CodingKeys: String, CodingKey { case zipCode = "zip_code" } inside the struct to map a single property. Option 1 is simplest for full snake_case APIs; option 2 keeps the rest of the JSON unchanged.
How do I deserialize the generated struct?
let decoder = JSONDecoder(); let root = try decoder.decode(Root.self, from: data) — that is everything Foundation needs once Root: Codable is declared. To handle ISO 8601 dates, set decoder.dateDecodingStrategy = .iso8601 before decoding. To map snake_case keys automatically, set decoder.keyDecodingStrategy = .convertFromSnakeCase.
Can I use this with SwiftUI and Combine?
Yes. The generated Codable struct is a value type so it composes safely with SwiftUI @State and @Published properties. With Combine: URLSession.shared.dataTaskPublisher(for: url).map(\.data).decode(type: Root.self, decoder: JSONDecoder()) gives you a Publisher<Root, Error> for a single line of pipeline code. With async/await: let (data, _) = try await URLSession.shared.data(from: url); let root = try JSONDecoder().decode(Root.self, from: data).
How are nested JSON objects modelled?
Each nested object becomes its own top-level Swift struct also conforming to Codable so you can split them into separate .swift files. The parent struct holds a typed reference (var address: Address) and JSONDecoder recurses into the nested struct automatically.
How are JSON arrays of objects mapped?
Arrays of objects become [StructName] (Swift's shorthand for Array<StructName>). Arrays of primitives become [String], [Int], [Double], or [Bool]. JSONDecoder handles Swift arrays natively — no custom decoder required.
How are nullable / optional fields handled?
JSON null values produce Any? as a safe default. To express an optional field, change var name: String to var name: String? after copying — JSONDecoder then accepts both null and missing keys (as long as the field is declared optional) without throwing.
Is the JSON uploaded to your servers?
No. Conversion runs entirely in your browser via JavaScript. Open DevTools → Network and click Convert — no requests are made. JSON containing API keys, internal field names, or PII never leaves your machine.