I'm wondering whether I'm kind of abusing how easy it is to put multiple classes in a file in Kotlin. The API I'm working with has basically four important classes, each one of which of which has somewhat different fields based on what endpoint I'm calling (either extra or less fields, not like one field suddenly turns from string to int). It also has a bunch of other smaller ones.
So I'm curious as to what the sort of 'best practice' would be. Currently each endpoint has its own
Response
class, containing everything for that specific endpoint, so each class has exactly what it needs, which unfortunately causes a lot of duplicate code. Would it be better to just create single classes for the most important ones, put every possible field in there, and just reuse this? Below is the
Response
for the newest endpoint I just added.