Yao-Wen Mei
05/17/2022, 11:08 AM@Serializable
data class Project(val name:String, val owners: List<Users>)
@Serializable
data class Users(val name: String)
After serialization, I wish to get a nested map equals to:
val map = mutableMapOf<String, Any>()
map.put("name", "project_name")
map.put("owners", listOf(mapOf("name" to "user1"), mapOf("name" to "user2"))
Could you please give me some hint how can I implement this Encoder
please ( I do have a Decoder
working BTW)? Should my Encoder extend the AbstractEncoder()
or TaggedEncoder()
? May I get some document for how to implement this? The official guide only contains an example for serializing to List
, but does not show how to get the key values if I want to serialize to Map
. Thank you very much.Dominaezzz
05/17/2022, 4:14 PM