pajatopmr
08/27/2020, 7:19 AMpajatopmr
08/27/2020, 7:21 AMandylamax
08/27/2020, 7:29 AMpajatopmr
08/27/2020, 8:12 AMMarc Knaup
08/27/2020, 9:47 AMandylamax
08/27/2020, 10:11 AMNick Johnson
08/27/2020, 12:58 PMval json = Json{ }
), and then you can simply val classAsJson = json.encodeToString(MyClass.serializer(), myClassInstance)
and the corresponding decodeFromString
to load the string as a class. This is valid JSON that any library can deserializeCasey Brooks
08/27/2020, 2:21 PM.serializer()
to the kotlinx library to do the same. And it’s similar for polymorphic serialization, a library can use reflection to determine which subclass to create, while you’ll need to manually set up a serializerModule
for kotlinx to do that.Casey Brooks
08/27/2020, 2:23 PMMarc Knaup
08/27/2020, 2:47 PMandylamax
08/27/2020, 2:49 PMpajatopmr
09/14/2020, 5:17 AM