Open acampayo opened 4 years ago
@acampayo, I've seen it work using the @field:Json
annotation on properties of a Kotlin data class; if you want to try.
@JsonApi(type = "models")
data class OurModel(
@field:Json(name = "name")
val name: String
) : Resource()
Hi,
I'm trying to integrate your moshi-jsonapi in my Android Kotlin project, but I'm having an issue with the compatibility with the moshi-kotlin library (working with Retrofit). Basically, I'm extending your Resource object in my Kotlin classes and I've added the JsonapiInterceptor, but it seems there is a problem parsing the data, the library is not able to parse the attributes (in our case the "name") . I have implemented this like that:
and the implementation of my model
and our JSON response
Do you know if I'm doing something wrong? I'm sure the problem is related to the compatibility of your Java project library with Kotlin.
Thanks so much in advance