OpenAPI 规范 v3.1.0
OpenAPI 规范 v3.1.0
1. OpenAPI 规范
2. 简介
3. 定义
4. 规范
4.1 版本
4.2 格式
4.3 文档结构
4.4 数据类型
4.5 富文本格式化
4.6 URI 中的相对引用
4.7 URL 中的相对引用
4.8 模式
4.8.1 OpenAPI 对象
4.8.2 Info 对象
4.8.3 Contact 对象
4.8.4 License 对象
4.8.5 Server 对象
4.8.6 Server Variable 对象
4.8.7 Components 对象
4.8.8 Paths 对象
4.8.9 Path Item 对象
4.8.10 Operation 对象
4.8.11 External Documentation 对象
4.8.12 Parameter 对象
4.8.13 Request Body 对象
4.8.14 Media Type 对象
4.8.15 Encoding 对象
4.8.16 Responses 对象
4.8.17 Response 对象
4.8.18 Callback 对象
4.8.19 Example 对象
4.8.20 Link 对象
4.8.21 Header 对象
4.8.22 Tag 对象
4.8.23 Reference 对象
4.8.24 Schema 对象
4.8.25 Discriminator 对象
4.8.26 XML 对象
4.8.27 Security Scheme 对象
4.8.28 OAuth Flows 对象
4.8.29 OAuth Flow 对象
4.8.30 Security Requirement 对象
4.9 规范扩展
4.10 安全过滤
4.8.2 Info 对象
创建时间: 2025-05-29 16:38
该对象提供有关 API 的元数据。如果需要,客户端可以使用元数据,并且为了方便起见,可以在编辑或文档生成工具中呈现元数据。**
4.8.2.1 固定字段
字段名称 | 类型 | 描述 |
---|---|---|
title | 字符串 | 必需 。API 的标题。 |
summary | 字符串 | API 的简短摘要。 |
description | 字符串 | API 的描述。[CommonMark] 语法可以用于富文本表示。 |
termsOfService | 字符串 | API 的服务条款的 URL。这必须采用 URL 的形式。 |
contact | 联系对象 | 公开 API 的联系信息。 |
license | 许可证对象 | 公开 API 的许可证信息。 |
version | 字符串 | 必需 。OpenAPI 文档的版本(与 OpenAPI 规范版本 或 API 实现版本不同)。 |
此对象*可以使用 规范扩展 进行扩展。
4.8.2.2 Info 对象示例
{
"title": "Sample Pet Store App",
"summary": "A pet store manager.",
"description": "This is a sample server for a pet store.",
"termsOfService": "https://example.com/terms/",
"contact": {
"name": "API Support",
"url": "https://www.example.com/support",
"email": "support@example.com"
},
"license": {
"name": "Apache 2.0",
"url": "https://apache.ac.cn/licenses/LICENSE-2.0.html"
},
"version": "1.0.1"
}
title: Sample Pet Store App
summary: A pet store manager.
description: This is a sample server for a pet store.
termsOfService: https://example.com/terms/
contact:
name: API Support
url: https://www.example.com/support
email: support@example.com
license:
name: Apache 2.0
url: https://apache.ac.cn/licenses/LICENSE-2.0.html
version: 1.0.1
最后更新: -