知识卡片
路径加方法标识操作
先在 paths 下确定以 / 开头的相对路径,再在该路径下用 get、post 等方法写各自的参数、响应与描述。方法键使用小写,实际 HTTP 请求行使用大写方法。选对层级才能将规则限定到真正适用的操作。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Our first taste of OpenAPI definitions 3.4 Describing our first operation · 查看原书依据
We’ll define an operation as a URL and a single method. For example, GET /reviews is an operation, and it’s separate from POST /reviews. In this chapter we’ll focus on describing the GET /reviews operation sufficiently so that we can execute requests.
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第03章《Our first taste of OpenAPI definitions》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch03.htm,阅读块 80)
- 结论依据:原文明确 GET 和 POST 共享路径却是不同操作。
- 原始内容:We’ll define an operation as a URL and a single method. For example, GET /reviews is an operation, and it’s separate from POST /reviews. In this chapter we’ll focus on describing the GET /reviews operation sufficiently so that we can execute requests.