JakeWharton/retrofit2-kotlinx-serialization-converter

Polymorphic serializer Error

hmshohrab opened this issue · 2 comments

When I use "minifyEnabled true" that error message is thrown...

kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for missing class discriminator ('null') JSON input: {"success":true,"message":"Otp sent successfully","data":{"countryCode":"880","mobileNo":" 99999999","type":"New","testOtp":63401}}

how can i fix it?

try @keep
for all models

If you're using a Call like fun fetchSomething(): Call<Something>, make sure it's not a suspend function