I have below structure. what would be the best way...
# serialization
g
I have below structure. what would be the best way to deserialize based on
type
avalable in json string?
Copy code
sealed class Payload()
class SimplePayload(val name: String) : Payload()
class AdvancedPayload(val name: String, val description: String) : Payload()

Message<T : Payload>{
    val id: String,
	val type: String,
	val payload: T? = null
}