retrofit2-kotlinx-serialization-converter icon indicating copy to clipboard operation
retrofit2-kotlinx-serialization-converter copied to clipboard

Polymorphic serializer Error

Open hmshohrab opened this issue 1 year ago • 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?

hmshohrab avatar Aug 19 '23 04:08 hmshohrab

try @Keep for all models

JobGetabu avatar Sep 15 '23 22:09 JobGetabu

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

saurabhnmahajan avatar Oct 02 '23 09:10 saurabhnmahajan