For production code, in your data models, do you s...
# codingconventions
g
For production code, in your data models, do you specifiy
@SerialName
for all fields or just the required ones? 1.
Copy code
data class Foo(@SerialName("_id") val id: Int, @SerialName("name") val name: String)
2.
Copy code
data class Foo(@SerialName("_id") val id: Int, val name: String)
1️⃣ 10
2️⃣ 2
d
Yes if proguard is used, no otherwise (i.e. just the required ones) I think.
m
I only set them where they are required and use the @Keep annotation for proguard.
g
I prefer using the same
@SerializedName
annotation (even when redundant) when proguard is enabled. I believe that choosing between either
@SerializedName
or
@Keep
is largely subjective though