From bef28089bdc3c7bbaf9a63d06bd459c1dd48d951 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 22:00:45 +0800 Subject: [PATCH] =?UTF-8?q?schema=20=E5=A2=9E=E5=8A=A0=20type/enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define/openapi.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/define/openapi.go b/define/openapi.go index 76ee6e8..462619d 100644 --- a/define/openapi.go +++ b/define/openapi.go @@ -128,6 +128,8 @@ type Schema struct { Deprecated bool `json:"deprecated"` // 表示一个 schema 是废弃的,应该逐渐被放弃使用。默认值是 false. Properties map[string]*Property `json:"properties,omitempty"` // 数据字段 => 数据规则 Required []string `json:"required,omitempty"` // 必传属性列表 + Enum []any `json:"enum,omitempty"` // 枚举值列表 + Type string `json:"type"` // 类型 } // Property 是从 JSON Schema 提取出来的,但是做了一些调整以适应 OpenAPI Specification。