I need to concat multiple API calls and I'd like to use retrofit2 and rxJava observables to do that. My scenario is as follows:
I must do a first call that will return an array of objects, the response will be something like:
[{"title": "Title 1", "id": "1"}, {"title": "Title 2", "id": "2"}]
Then I need to do an API call per each object, so each object's API response will be something like:
[{"title": "Chapter A", "id": "1A", ...}, {"title": "Chapter B", "id": "1B", ...}, ...]
So I want to concat all those calls and merge it in a unique response object that would have all information. How could I do that? How can I do the first call then with the response do a call per object and wait till all calls have been done and merge the results?
Thanks a lot