From 1f5544a0aff68c0a625329830e1dfab34e14aa9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 19 Jul 2024 21:35:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=A2=9E=E5=8A=A0=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E5=80=BC=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define/openapi.go | 1 + 1 file changed, 1 insertion(+) diff --git a/define/openapi.go b/define/openapi.go index e53ebf3..786fc12 100644 --- a/define/openapi.go +++ b/define/openapi.go @@ -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 指向对象描述