feature/openapi增加openapi版本文档数据结构定义 #1
@ -17,7 +17,23 @@ type OpenapiDoc struct {
|
||||
Info *Info `json:"info" required:"true"` // 必选。此字段提供 API 相关的元数据。相关工具可能需要这个字段。
|
||||
Servers []*ServerItem `json:"servers"` // 服务环境
|
||||
Tags []TagItem `json:"tags"` // 全部标签列表
|
||||
Paths map[string]map[string]*PathItemConfig `json:"paths"` // 接口路径 -> 接口请求方法 -> 具体配置
|
||||
Paths map[string]*PathConfig `json:"paths"` // 接口路径 -> 接口请求方法 -> 具体配置
|
||||
}
|
||||
|
||||
// PathConfig ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 18:06 2024/7/19
|
||||
type PathConfig struct {
|
||||
Get *PathItemOperationConfig `json:"get"` // 定义适用于此路径的 GET 操作。
|
||||
Put *PathItemOperationConfig `json:"put"` // 定义适用于此路径的 PUT 操作。
|
||||
Post *PathItemOperationConfig `json:"post"` // 定义适用于此路径的 POST 操作。
|
||||
Delete *PathItemOperationConfig `json:"delete"` // DELETE
|
||||
Options *PathItemOperationConfig `json:"options"` // 定义适用于此路径的 OPTIONS 操作。
|
||||
Head *PathItemOperationConfig `json:"head"` // 定义适用于此路径的 HEAD 操作。
|
||||
Patch *PathItemOperationConfig `json:"patch"` // 定义适用于此路径的 PATCH 操作。
|
||||
Trace *PathItemOperationConfig `json:"trace"` // 定义适用于此路径的 TRACE 操作。
|
||||
}
|
||||
|
||||
// PathItemConfig 接口的具体配置
|
||||
@ -34,14 +50,7 @@ type PathItemConfig struct {
|
||||
Deprecated bool `json:"deprecated"` // 是否已弃用
|
||||
Description string `json:"description"` // 一个可选的详细说明字符串,用于描述此路径包含的所有操作。 CommonMark syntax 可以被用来呈现富文本格式.
|
||||
Tags []string `json:"tags"` // 接口标签列表
|
||||
Get *PathItemOperationConfig `json:"get"` // 定义适用于此路径的 GET 操作。
|
||||
Put *PathItemOperationConfig `json:"put"` // 定义适用于此路径的 PUT 操作。
|
||||
Post *PathItemOperationConfig `json:"post"` // 定义适用于此路径的 POST 操作。
|
||||
Delete *PathItemOperationConfig `json:"delete"` // DELETE
|
||||
Options *PathItemOperationConfig `json:"options"` // 定义适用于此路径的 OPTIONS 操作。
|
||||
Head *PathItemOperationConfig `json:"head"` // 定义适用于此路径的 HEAD 操作。
|
||||
Patch *PathItemOperationConfig `json:"patch"` // 定义适用于此路径的 PATCH 操作。
|
||||
Trace *PathItemOperationConfig `json:"trace"` // 定义适用于此路径的 TRACE 操作。
|
||||
|
||||
Parameters []*PathConfigParameter `json:"parameters"` // 参数列表, 对于所有请求生效
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user