2

I hane an api response that I want to be represented like an enum. The problem is that api response returns integer values. Is it possible moshi handle this case without writing custom adapters on my own?

Example(I want to display rating and type as enums):

{
        "id": 0,
        "type": 0,
        "displayName": "nikos",
        "avatar": 0,
        "rating": 0,
        "language": "en"
}
Nikos M
  • 194
  • 6
  • please provide relevant code with current response and how would you like the response to look like. keep in mind that ENUM is something that's defined in your code, in the JSON response it's just like any string! – Nir Alfasi Jun 02 '21 at 08:55
  • Please take a look at edited question – Nikos M Jun 02 '21 at 08:59

0 Answers0