https://kotlinlang.org logo
#serialization
Title
# serialization
d

dave08

03/11/2024, 1:29 PM
I want to compute key/value based on existing properties and that it should appear in the json produced, but it doesn't seem to work...
Copy code
@Serializable data class Foo(val id: Int, val name: String) { val computed: String? = "$id --- $name" } // computed doesn't appear in the resulting json...
how can I get this to work?
d

dave08

03/11/2024, 4:06 PM
Thanks, that works great!
🚀 1