https://kotlinlang.org logo
Title
s

Shawn

01/23/2018, 8:04 PM
not sure what kind of api you’re working with, but if you can’t expect a given object to be shaped the same way each time you request it, I feel like you have bigger problems
j

jkbbwr

01/23/2018, 8:06 PM
Its more common than you think with JSON apis
s

Shawn

01/23/2018, 8:08 PM
feel like that’s a design problem regardless of the media type lol
c

cedric

01/23/2018, 9:03 PM
@oday Why make these
vars
, doesn’t Gson supports
vals
?
As for default values, depends on your situation: are missing parameters in JSON an error or acceptable? If the latter, specify default values in your Kotlin class