I have a class:
@JsonClass(generateAdapter = true)
data class DayAveragePriceModel(
val asset: Asset,
val value: BigDecimal
)
where Asset
is a custom class I have. I'm trying to use Moshi
but I'm getting the following error:
Caused by: java.lang.IllegalArgumentException: Platform class java.math.BigDecimal (with no annotations) requires explicit JsonAdapter to be registered
How can I work around this? I tried with
return Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.add(Object::class.java)
.build()
}
but it is crashing.
Thanks a lot in advance!