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.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
最后更新: -