kubele
07/14/2021, 5:13 PM@Serializable
data class Foo(
val list: List<String> = emptyList()
)
val foo = Json.encodeToString(Foo())
println(foo)
prints
{}
but this implementation:
@Serializable
data class Foo(
val list: List<String>
)
val foo = Json.encodeToString(Foo(emptyList()))
println(foo)
prints
{
"list": []
}
I have no idea why it’s not
{
"list": []
}
in both casesjw
07/14/2021, 5:20 PMJson
configuration, though.jw
07/14/2021, 5:25 PM