Lost Illusion
02/05/2022, 11:04 PM{
"type": 1,
"realm": "dev"
}
would actually be serialized as
[1, "dev"]
and I'm not too sure how to go about this. I was going to go with a message hierarchy and then delegate to the specific serializer based off the type, which I've successfully done before with the first JSON example. Though, I'm not sure how to do that with the second example, nor how to even (de)serialize the second example into a class that would look like this.
data class Foo(val type: Int, val realm: String)
It'd be nice to know if this is even possible, since I'm completely stumped on how to create a proper descriptor for the second situation.
Thanks.Lost Illusion
02/06/2022, 12:24 AM