Peter
11/08/2021, 10:16 PMdata class Test(val a: String) {
val b: String = "alwaysthesame"
}
i’m looking for Test("x")
to be {"a": "x", "b": "alwaysthesame"}
Peter
11/08/2021, 10:21 PMPaul Griffith
11/08/2021, 10:23 PMPaul Griffith
11/08/2021, 10:24 PMBen Woodworth
11/09/2021, 4:45 AMdata class Test(val a: String) {
val b: String
init {
b = "alwaysthesame"
}
}
I think it might not be encoding because encodeDefaults is false, and b has the default value "alwaysthesame"Ben Woodworth
11/09/2021, 4:49 AM@EncodeDefault
val b: String = "alwaysthesame"