0
@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?

luckysing_noobster
  • 1,933
  • 5
  • 24
  • 50

1 Answers1

1

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
)
manusobles
  • 199
  • 1
  • 8