java – need to create dynamic class without create model based on api-ThrowExceptions

Exception or error:

i want to create a dynamic class based on api response, is it possible or not? I don’t want to create model or setter/getter method in Android.

How to solve:

You could use Kotlin.Serialization library and create map based on your response.

https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/runtime_usage.md#mapper

Leave a Reply

Your email address will not be published. Required fields are marked *