知识卡片
paths声明端点交互契约
OpenAPI 的 paths 部分按 URL 路径组织端点,每条路径再列它支持的 HTTP 方法、请求参数与载荷、响应格式和状态码。消费者据此知道如何调用接口;设计者也能检查路径和方法组合是否有遗漏。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 5 章《Documenting REST APIs with OpenAPI》(源文件:_epub-src/OEBPS/Text/05.htm)
- 结论依据:原文说明 paths 是 API 接口的描述,逐项列出 URL、方法、请求、响应和状态码;每条路径下的方法是其属性。
- 原始内容:the paths section of an OpenAPI specification describes the interface of your API. It lists the URL paths exposed by the API, with the HTTP methods they implement, the types of requests they expect, and the responses they return, including the status codes. Each path is an object whose attributes are the HTTP methods it supports.