It's my first time dealing with JSON in android studio, and I'm trying to parse the response from google books API to JSON and then retrieve some info about the volume such as the title, author, and the description. the problem is there are JSON objects within the main JSON. Should I create a data class for each JSON?
the API link 'https://www.googleapis.com/books/v1/volumes?q=kotlin'
how i'm parsing it
val jsonResponse = gson.fromJson(body, JsonResponse::class.java)
the data classes that i created
data class JsonResponse
(val kind:String,val count:String,val items:List<JsonItems> )
data class JsonItems
(val kind:String,
val id:String,
val etag:String,
val self:String,
val volumeInfo:List<VolumeInfo>,
val saleInfo:List<SaleInfo>,
val accessInfo:ListList<AccessInfo> ,
val searchInfo:List<SearchInfo>)
is there any simpler solution to avoid unused data classes?