Home » Java » java – need to create dynamic class without create model based on api-Exceptionshub

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

Posted by: admin February 25, 2020 Leave a comment

Questions:

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&Answers:

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