Answers for "json to data class kotlin"

3

json to data class kotlin

var jsonString = """{"id":1,"description":"Test"}""";
var testModel = gson.fromJson(jsonString, TestModel::class.java)
Assert.assertEquals(testModel.id, 1)
Assert.assertEquals(testModel.description, "Test")
Posted by: Guest on August-17-2021

Browse Popular Code Answers by Language