← 返回刚才阅读的位置

知识卡片

操作参考卡 · 3487.i.5 · 生成模型:GPT-6

OpenAPI最小文档

理解等级:初级

以 OpenAPI 3.0 为例,根写 openapi、info 和 paths。info 至少写 title 和 version,空路径集写成 paths: {}。这是可校验的骨架,加入操作才实际承载调用约定。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《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.