知识卡片
业务动作与接口非一对一
多个业务动作可以共享一项操作,只要它们的语义可用明确资源状态表达。比如在申请上改变状态。服务仍需针对角色与当前状态检查转移是否允许,接口复用并不意味着放开任意状态写入。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Creating an API design using OpenAPI 10.4 API operations for PetSitter · 查看原书依据
If there was another action, like “Deny,” which the PetSitter application will likely have down the line, but which we have not included in the current domain model, the same operation can be used. The lesson is that not every action in
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第10章《Creating an API design using OpenAPI》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch10.htm,阅读块 251)
- 结论依据:申请批准和未来的拒绝可走同一修改接口,通过状态值区分。
- 原始内容:If there was another action, like “Deny,” which the PetSitter application will likely have down the line, but which we have not included in the current domain model, the same operation can be used. The lesson is that not every action in