xxxxxxxxxx
install JSON to Kotlin Class (JsontoKotlinClass) plugin in android studio
then right click on your package directory and create Kotlin Data Class From Json file
and generate in it will create Data class from json
xxxxxxxxxx
var jsonString = """{"id":1,"description":"Test"}""";
var testModel = gson.fromJson(jsonString, TestModel::class.java)
Assert.assertEquals(testModel.id, 1)
Assert.assertEquals(testModel.description, "Test")