知识卡片
新增操作优先复用惯例
先排除能准确、高效满足场景的已有操作。若需要新增,优先与同一 API 的查询方式一致,例如按工作列申请已经用子集合,按用户列申请也用同一结构。可预测的类比减少客户端猜测。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Implementing frontend code and reacting to changes 12.4 Identifying a missing API operation · 查看原书依据
The first is quite adequate, allowing us to add more query parameters to filter out the job applications based on other criteria. But we are already using the second pattern in /jobs/{id}/job-applications, and having consistent patterns in our API is valuable (the
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第12章《Implementing frontend code and reacting to changes》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch12.htm,阅读块 112)
- 结论依据:收集申请时比较了通用过滤和已有子集合模式。
- 原始内容:The first is quite adequate, allowing us to add more query parameters to filter out the job applications based on other criteria. But we are already using the second pattern in /jobs/{id}/job-applications, and having consistent patterns in our API is valuable (the