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.29 OAuth Flow 对象
创建时间: 2025-05-29 16:38
支持的OAuth流程的配置详细信息
4.8.29.1 固定字段
字段名称 | 类型 | 应用于 | 描述 |
---|---|---|---|
授权URL | 字符串 | oauth2 ("implicit" , "authorizationCode" ) | 必需。要用于此流程的授权URL。这必须采用URL的形式。OAuth2标准要求使用TLS。 |
令牌URL | 字符串 | oauth2 ("password" , "clientCredentials" , "authorizationCode" ) | 必需。要用于此流程的令牌URL。这必须采用URL的形式。OAuth2标准要求使用TLS。 |
刷新URL | 字符串 | oauth2 | 用于获取刷新令牌的URL。这必须采用URL的形式。OAuth2标准要求使用TLS。 |
范围 | Map[string , string ] | oauth2 | 必需。OAuth2安全方案的可用范围。范围名称与其简短描述之间的映射。该映射可以为空。 |
此对象*可以使用 规范扩展 进行扩展。
4.8.29.2 OAuth Flow 对象示例
{
"type": "oauth2",
"flows": {
"implicit": {
"authorizationUrl": "https://example.com/api/oauth/dialog",
"scopes": {
"write:pets": "modify pets in your account",
"read:pets": "read your pets"
}
},
"authorizationCode": {
"authorizationUrl": "https://example.com/api/oauth/dialog",
"tokenUrl": "https://example.com/api/oauth/token",
"scopes": {
"write:pets": "modify pets in your account",
"read:pets": "read your pets"
}
}
}
}
type: oauth2
flows:
implicit:
authorizationUrl: https://example.com/api/oauth/dialog
scopes:
write:pets: modify pets in your account
read:pets: read your pets
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
write:pets: modify pets in your account
read:pets: read your pets
最后更新: -