@JsonClass(generateAdapter = true)
data class Note(val name)
Do I need to parcelize the above model I am using Moshi and change it to something like
@Parcelize
@JsonClass(generateAdapter = true)
data class Note(val name) : Parcelable
Why do we even need to parcelize this data class?
You should not need to add @Parcelize
, but you may want to add the @Json
annotation to the field. Also, you were missing the type of the property name
.
@JsonClass(generateAdapter = true)
data class Note(
@field:Json(name = "name")
val name: String
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.