Does anyone know why this custom `Moshi` adapter (...
# squarelibraries
g
Does anyone know why this custom
Moshi
adapter (for serialization only) is not being called? If i replace
ApiType
with the specfic enum type (
Gender
) it works.
Copy code
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
  }
}