I have a data class ```data class Response( @Seria...
# android
s
I have a data class
Copy code
data class Response(
@SerializedName("someVariable") var type: Long?=null)
I can get null value from the server, but in my code I am only bothered with non null value of someVariable. Would it be right approach to write someVariable as nonNullable Response class as
Copy code
data class Response(
@SerializedName("someVariable") var type: Long=0)
r
Depends on your use case, but you shouldn’t need a default, if you make it nullable