0

this is my json to parse:

["AA", "BB", "unknown"]

I need to decode with List<enum> that doesn't contain unknown element. I can get list of 3 element with 1 null or list of 2 element.

i tryed KindListSerializer but how to apply to root element?

Alessandro Scarozza
  • 4,273
  • 6
  • 31
  • 39

1 Answers1

0

solution:

Json.decodeFromString(KindListSerializer(EnumClass.serializer()), """["AA", "BB", "unknown"]""")
Alessandro Scarozza
  • 4,273
  • 6
  • 31
  • 39