/json-2-kotlin

Convert JSON to Kotlin Data Classes

Primary LanguageKotlinMIT LicenseMIT

Json2Kotlin

Converts a JSON string into Kotlin data classes.

About

As you've probably guessed by now, this project automatically converts JSON to Kotlin source files. The tool itself is implemented 100% in Kotlin, and makes heavy use of Square's excellent KotlinPoet library.

Read the blog post which covers how this multi-platform tool was written.

View the source to suggest improvements.

Grab the command line tool from the latest release.

Get in touch on Twitter if you have questions, comments, or simply enjoy high-quality cat gifs.

Running

Run ./gradlew bootRun and visit http://localhost:8080

Releasing

Command Line

Run ./gradlew assembleDist, unzip the archive, and navigate to bin.

Then specify the json file, e.g. ./cmdline -input /c/Users/<User>/json2kotlin/bin/test.json

Spring

Deploy the JAR to AWS using ./gradlew bootRepackage