知识卡片
先限定可排序字段
只承诺有实际场景且后端能够支撑的排序。PetSitter 的时间和活动对应找工作场景。先以单值表达字段和方向,后续需要更多层排序时可扩容字段与语法,同时验证过去的单值仍有效。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Scaling collection endpoints with filters and pagination 17.7 Sorting for PetSitter · 查看原书依据
With only three sortable fields, we don’t necessarily need multifield sorting (section 17.6.2); including single-field sorting in our API should be enough. Still, there’s a potential future use case when we have more fields that we could use for sorting, so we’ll
参考来源
- 位置:《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,阅读块 329)
- 结论依据:原文将当前三个可用字段和未来多键能力分成两步。
- 原始内容:With only three sortable fields, we don’t necessarily need multifield sorting (section 17.6.2); including single-field sorting in our API should be enough. Still, there’s a potential future use case when we have more fields that we could use for sorting, so we’ll