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
rkeazor
07/15/2018, 2:11 PM
Depends on your use case, but you shouldn’t need a default, if you make it nullable