If you had a article and you included comments, all of the comments would be returned in the response.
Now lets say that this article has 100,000 comments associated to it. If we returned all 100,000 comments in one request, the server might timeout or the amount data may be too large.
In this case, is there a way to paginate the number of comments in the relationships/included array?.. should we not allow for includes? … is there something that I have not thought of?
“Pagination links MUST appear in the links object that corresponds to a collection. To paginate the primary data, supply pagination links in the top-level links object. To paginate an included collection returned in a compound document, supply pagination links in the corresponding links object.”
My problem is understanding what exactly is the links object that corresponds to items in the included section - since that section is an array, I don’t see where that links object would even go.
After theory-crafting out scaling issues, it became apparent we would need to paginate includes if we returned them… BUT we would also want to have a mechanism for allowing to specify what “page” we are paginating each includes on and return them properly. This was a pain in the … well you know. It also came to our attention that if we did paginate the includes, some partners may assume the includes we would returning are all of them, not just a subset.
Because the spec does no specify how to do this completely, we decided not to implement includes. (includes are not required for spec as far as I can tell). This does mean partners must make more requests. But the up side: we can limit the number of queries per request to a manageable number and keep response times sub 100ms.
My problem is understanding what exactly is the links object that corresponds to items in the included section - since that section is an array, I don’t see where that links object would even go.
Did you ever get an answer for this?
Because I have the same issue understanding where exactly to put pagination links for included collections.
I know it´s more than seven years ago, but helpful answers are always appreciated