Hi there! I am looking for a way to decode a strin...
# serialization
p
Hi there! I am looking for a way to decode a string into an object without having to know the serializer. Something like:
Copy code
val type: KType = ...
val result = Json.decodeFromString(ktype, string)
Does this functionality exist? Or asked the other way around: Is there something like a serializer-registry, that will give me the serializer for a given KClass or KType? Thanks!
Ok got it:
Copy code
json.serializersModule.serializer(type)