hey, I’m looking into serializing a Kotlin Redux S...
# squarelibraries
b
hey, I’m looking into serializing a Kotlin Redux State(data + sealed classes) on Android using Moshi. We have many individual screens resulting in 1+ sealed classes for each screen. This results in needing to add more and more adapters to this general Moshi state serializer. I’m curious as to why Moshi (and even GSON has this hurdle) requires manual creation of these individual PolymorphicJson adapters I’d love to take advantage of codegen or reflection but that doesn’t seem to be an option here so that the implementation of state serialization can be as “out of the box” as possible for future developers who are adding into the app. Has anyone serialized a large number of sealed classes in a way that doesn’t require adding tons of adapters?
g
You might want to check https://github.com/kotlin/kotlinx.serialization instead of Moshi