Is there a way to force Gson to discard any JSON o...
# android
l
Is there a way to force Gson to discard any JSON object with null properties when marshaling into Kotlin's non-null data classes? I am working with a client's backend and can't guarantee they won't break their contract, but also don't want nullable objects floating through the entirety of an application.
stackoverflow 6
r
could
GsonBuilder().serializeNulls().create()
do the trick?
n
@locke if you found an answer, i would love to hear from you
d
#klaxon does that I think, also maybe Moshi with Kotshi (I didn't try the latter).