属性增加枚举值定义

This commit is contained in:
白茶清欢 2024-07-19 21:35:22 +08:00
parent 11bf768221
commit 1f5544a0af

View File

@ -137,6 +137,7 @@ type Schema struct {
type Property struct {
Type string `json:"type"` // 数据类型, swagger本身的定义
Format string `json:"format"` // 对应编程语言中的数据类型描述
Enum []any `json:"enum,omitempty"` // 枚举值列表
Default any `json:"default"` // 默认值 : 不同于 JSON Schema这个值必须符合定义与相同级别的 Schema 对象 中定义的类型,比如 type 是 string那么 default 可以是 "foo" 但不能是 1。
Description string `json:"description"` // 数据描述, CommonMark syntax可以被用来呈现富文本格式.
AllOf []*PropertyXOf `json:"allOf,omitempty"` // type 是一个对象, allOf 指向对象描述