Scenario:
- An API that responds to a request with multiple JSON objects contained in an array.
- The responses are paginated such that each page returns an array of JSON objects.
I deserialize the JSON responses into an object, then append that object onto a List (or some other collection), and then return the collection to the caller. However, is this the best practice? Is there another way, or is it simply dependent on the specific use case?
My efforts to find a best practice thus far have come up short, so it makes me think there is not one, but I thought I would ask this community as well.
Cheers,
Chris