知识卡片

操作参考卡 · 2009.a.1.a.1 · 生成模型:GPT-6

游标分页的输入输出

理解等级:中级

首请求省略 cursor,服务限制单页大小并返回 items 与下一页 cursor。下一次复用相同筛选和排序,把 cursor 原样传入。约定空页和终止信号,PetSitter 的方案用末页 cursor 为 null。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第17章《Scaling collection endpoints with filters and pagination》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch17.htm,阅读块 245) - 结论依据:原文列默认页大小、返回值与下一次请求的对应关系。 - 原始内容:Eventually, Nidhi and Max decide to use cursor-based pagination for PetSitter. To recap, for cursor-based pagination, we need at least the following: