Gratis · Sviluppo
Da JSON a Swift Codable.
Trasforma un esempio JSON in struct Swift Codable con CodingKeys per le chiavi in snake_case, opzionali e tipi annidati.
Loading the calculator…
Come usare questo strumento: Da JSON a Swift Codable
Inserisci i dati o scegli il file. Regola le opzioni, genera il risultato e controllalo prima di copiarlo o scaricarlo.
Limiti e formati supportati
I dati vengono elaborati sul tuo dispositivo.
Note tecniche in inglese
Types are inferred from the sample only. Everything is calculated in your browser; nothing you type is uploaded.
Integers map to Int, decimals to Double, arrays to [T]; optional or null fields become optionals. A small JSONValue enum is added when a field’s type varies.
user_name becomes let userName: String with case userName = "user_name" in CodingKeys.