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

Demis

03/18/2024, 10:10 PM
Hi can someone help out with a particular task Im struggling. I have an account json response from backend and deserialize it to data class. The task I have is that I need to add another property to data class for an additional account that is new and has slightly different json response. So different type......how would be the best way to add that property to the data class so that I do not break the rest of the code?
not kotlin but kotlin colored 1
a

Andrea Alberti

03/18/2024, 11:15 PM
Have you tried to add new property nullable and default value null?
👍 1
d

Demis

03/21/2024, 9:00 PM
That's what I did eventually....but there was another issue
Thanks