Slackbot
10/10/2020, 3:45 AMmbonnin
10/10/2020, 9:04 AMList<Any> but you could serialize List<BaseType> where BaseType is a super type for all your list elements.mbonnin
10/10/2020, 9:05 AMJsonElement then you can construct your JsonElement at runtime without having to worry about typesJason5lee
10/10/2020, 9:17 AM[1, [2, 3], 4] .mbonnin
10/10/2020, 9:33 AMJsonArray(
listOf(
JsonPrimitive(1),
JsonArray(
listOf(
JsonPrimitive(2),
JsonPrimitive(3),
)
),
JsonPrimitive(4),
)
).toString()
It's verbose but it'll work