I have a Kotlin project that requires serializing JSON to and from data objects. I’m considering using Moshi to do this. This project also uses the GraalVM native-compile to generate a native Amazon lambda image for deployment to AWS.
Moshi supports two methods for creating adapters for data objects: Kotlin reflection, and code generation via a Gradle plugin. I want to use code generation so I can avoid the Kotlin reflection dependency.
I came across a library for Moshi called Kotshi whose specific purpose is to generate Moshi adapters from Kotlin classes, again avoiding the need for Kotlin reflection.
My question: What are the differences between Moshi’s native code generation, and that provided by Kotshi? I suspect that Kotshi was created for a particular reason, but it seems that Moshi also provides code generation. If I’m starting from scratch, which one should I use?