incorrect nextPageToken Bug in Google Classroom API V1

天涯浪子 提交于 2019-12-13 18:36:03

问题


When asking for a list of courses (or any list), if the list is empty a nextPageToken is still returned, there may be a very good reason for this, but maybe not. It makes it seem like there is still more information to get. I message saying "no more items" or something would be more useful.

I think is happening because we had a lot of courses, then they were all deleted.

I used this page to help test. https://developers.google.com/classroom/reference/rest/v1/courses/list


回答1:


There is a known issue that although deleted courses aren't returned in a response, they still use up spots in the response, sometimes leading to sparse or empty pages of results. In this case however the nextPageToken is actually correct, as there may be non-deleted courses returned after the first page. The paging logic should always be that you continue to fetch pages until the nextPageToken field is missing, regardless of how many items are returned in the response.



来源:https://stackoverflow.com/questions/32567498/incorrect-nextpagetoken-bug-in-google-classroom-api-v1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!