免费 · 开发
JSON 转 Kotlin 数据类.
把 JSON 示例转换为适用于 kotlinx.serialization 的 Kotlin data class,带 @SerialName 和可空的可选字段。
Loading the calculator…
使用方法: JSON 转 Kotlin 数据类
输入数据或选择文件,调整设置并生成结果。复制或下载之前,请检查结果。
限制与支持格式
输入内容在您的设备上处理。
英语技术说明
Types are inferred from the sample only. Everything is calculated in your browser; nothing you type is uploaded.
Integers map to Long, decimals to Double, lists to List<T> and varying values to JsonElement. Kotlin keywords are escaped with backticks.
user_name becomes @SerialName("user_name") val userName: String; a coupon present in only one order becomes String? = null.