TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Instantly generate Kotlin types and serializers from JSON

2 点作者 dvdsgl大约 7 年前

1 comment

dvdsgl大约 7 年前
quicktype infers types from JSON, then outputs models in Swift, Java, Objective-C, and many other languages for reading that data. We just released Kotlin support today, and we&#x27;re looking for feedback on the generated code, or what we could improve.<p>As usual, quicktype will:<p><pre><code> * Infer nice class and property names * Generate convenient `fromJson` and `toJson` methods for top-level types, including top-level arrays and maps * Deduplicate types inferred to be the same * Detect enums and emit custom marshaling code for them * Detect heterogeneous JSON data and emit sealed classes with custom marshaling code to keep your Kotlin typesafe * Distinguish Map&lt;String, *&gt; from custom object types automatically using Markov chains </code></pre> Thank you for taking a look!