PasteZap
🌐 简体中文
免费 · 无需注册

免费 · 开发

JSON 转 Swift Codable.

把 JSON 示例转换为 Swift Codable 结构体,为 snake_case 键生成 CodingKeys,支持可选值和嵌套类型。

开始之前

部分技术控件使用英语。支持 Unicode 文本;文件格式和输出语言取决于具体工具。

下面以英语列出技术限制。处理大型文件或使用结果之前,请先查看这些限制。

Loading the calculator…

使用方法: JSON 转 Swift Codable

输入数据或选择文件,调整设置并生成结果。复制或下载之前,请检查结果。

限制与支持格式

输入内容在您的设备上处理。

英语技术说明

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.