TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Instantly generate Kotlin types and serializers from JSON

2 pointsby dvdsglabout 7 years ago

1 comment

dvdsglabout 7 years ago
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!