You are currently viewing Compile time safety with json serialization

Compile time safety with json serialization

Is there any Kotlin library that would throw a compile time error when trying to serialize a class that cannot be serialized (serializer not defined, no expected annotation etc.)? Kotlinx serialization catches nicely the case when I have non serializable fields in a data class, but when calling Json.encodeToString it compiles, but throws errors in runtime

submitted by /u/zdzizslaw_ziemniak
[link] [comments]