feature/openapi增加openapi版本文档数据结构定义 #1

Merged
zhangdeman merged 15 commits from feature/openapi into master 2024-07-19 22:06:14 +08:00
Showing only changes of commit 3895be6e15 - Show all commits

View File

@ -127,6 +127,7 @@ type Schema struct {
Example string `json:"example,omitempty"` // 一个用于示范此 schema实例的示例可以是任意格式。为了表达无法用 JSON 或 YAML 格式呈现的示例,可以使用 string 类型的值,且在必要的地方需要使用字符转义。
Deprecated bool `json:"deprecated"` // 表示一个 schema 是废弃的,应该逐渐被放弃使用。默认值是 false.
Properties map[string]*Property `json:"properties,omitempty"` // 数据字段 => 数据规则
Required []string `json:"required,omitempty"` // 必传属性列表
}
// Property 是从 JSON Schema 提取出来的,但是做了一些调整以适应 OpenAPI Specification。