for example in my case, the “err” field is not alw...
# serialization
d
for example in my case, the “err” field is not always there
j
String?
d
I think I found out:
Copy code
@Serializable
data class ApiResponse(
    @SerialName("data") val data : List<CovidRow>,
    @SerialName("err") val error : String? = null,
)
String? = null
thanks
j
So you need to indicate the default parameter?
d
yes, if I don’t write “= null” it gives an error, in case the response doesn’t include that field