知识卡片
集合能力用查询参数组合
在已有 GET 集合路径添加可选的过滤、排序和页参数,三者可以组合,省略时使用清晰的默认行为。OpenAPI 能写参数格式,仍需在描述交代边界、组合和默认顺序等运行语义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Scaling collection endpoints with filters and pagination 17.1 The problem · 查看原书依据
With these semantics, query parameters are the obvious choice. So, to recap, to implement filtering, pagination, and sorting for resource collections in an API, we don’t need additional endpoints. Instead, we can extend our collection endpoints with query parameters. The crucial part
参考来源
- 位置:《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,阅读块 35)
- 结论依据:原文经过独立路径、查询和 HTTP 头的比较选择查询参数。
- 原始内容:With these semantics, query parameters are the obvious choice. So, to recap, to implement filtering, pagination, and sorting for resource collections in an API, we don’t need additional endpoints. Instead, we can extend our collection endpoints with query parameters. The crucial part