Mate
01/30/2019, 12:58 PM@Serializable
data class Foo(
val a: String,
val b: List<String>
)
I'd like to handle read/write asymmetrically in this case (using JSON):
- For read I'd like to read both a and b properties from json string
- For write however I'd like to serialize only b to json string
I've tried the Mapper to convert this to a map remove the unwanted key, but then I could not find a way to serialize the Map<String, Any>
What do you think would be the best solution for this case?
Something like @Transient(In|Out|InOut) would be great 🙂JoakimForslund
01/30/2019, 3:23 PMval a:String? = null
be enough?Mate
01/31/2019, 11:31 AMMate
01/31/2019, 11:31 AMJoakimForslund
01/31/2019, 4:00 PM