知识卡片
OpenAPI最小文档
以 OpenAPI 3.0 为例,根写 openapi、info 和 paths。info 至少写 title 和 version,空路径集写成 paths: {}。这是可校验的骨架,加入操作才实际承载调用约定。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Using Swagger Editor to write OpenAPI definitions 4.2 Writing the smallest OpenAPI definition in Swagger Editor · 查看原书依据
We need a title and a version (the version of the API definition, not of the specification); both of those fields fall under the info object. When we write it out, it looks like the following listing.
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第04章《Using Swagger Editor to write OpenAPI definitions》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch04.htm,阅读块 43)
- 结论依据:正文明确 info 需要标题和定义版本,并随后添加空 paths。
- 原始内容:We need a title and a version (the version of the API definition, not of the specification); both of those fields fall under the info object. When we write it out, it looks like the following listing.