We have an api response that is saved as string in a field in Table1. And let's say we have these contracts to match the saved json string.
AifCollectionTypeAttribute('return',Types::Class, classStr(HobbyDataContract))]]
//there is more but let's stick to those two for demo purposes
We also have this helper class
-------------------------------------------------------------
Please note that the api returns about 30 fields. And only 6 fields out of 30 will need to be reformatted using helper class. Also there are other apis that can return similar response and those 6 fields will still need sameexact reformatting, that's why i created a helper class, as other classes for other apis might call it.
1. Do you think the code is readable in getData method? or is there a better way to do it?
2. Also is it a good practice, to remove the helper class and do all of this in the same contract class?
i think contract class shouldn't include this but i want to double check. I mean, if sth like this is acceptable:
AifCollectionTypeAttribute('return',Types::Class, classStr(HobbyDataContract))]]