Gunis
03/10/2021, 12:24 PMMoshi
adapter (for serialization only) is not being called? If i replace ApiType
with the specfic enum type (Gender
) it works.
class ApiTypeAdapter {
@ToJson
fun toJson(apiType: ApiType): Int {
return apiType.id
}
}
interface ApiType {
val id: Int
}
enum class Gender: ApiType {
MALE {
override val id: Int = 1
},
FEMALE {
override val id: Int = 2
}
}