I noticed a lot of work on moshi and kotlin code g...
# serialization
h
I noticed a lot of work on moshi and kotlin code generation using kotlinpoet. https://github.com/square/moshi
g
Cool. Looks like moshi will generate type adapters for Kotlin Like Kotshi
h
currently I hacked my json “serializer”.
Copy code
private fun simpleJsonAdapter(): JsonAdapter<JsonCommandList> {
    val moshi = Moshi.Builder().build()
    val listOfCommands = Types.newParameterizedType(
        List::class.java,
        Map::class.java
    )
    return moshi.adapter(listOfCommands)
}
Oh I didn’t know about kotshi. Will try it out.
but since the core of moshi is written in java (incl. okio) I’ll have to migrate to kotlinx.serializer sooner or later to build my multiplatform project
g
Sure, you cannot use moshi for multiplatform (only as JVM implementation)
problem with moshi is a way how moshi works: uses java reflection, no way to port it for multiplatform
h
yeah. kotlin.ser has a much bigger goal. multiple platforms and multiple formats (json, protobuf, …)
and the recent feature branch that uses kotlinx-io