From 3895be6e1568d407100a3296e1e0cf4b9055e094 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:55:12 +0800 Subject: [PATCH] =?UTF-8?q?schema=E5=A2=9E=E5=8A=A0required,=20=E4=BB=A3?= =?UTF-8?q?=E8=A1=A8=E5=BF=85=E4=BC=A0=E5=B1=9E=E6=80=A7=E5=88=97=E8=A1=A8?= 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 f740fb8..76ee6e8 100644 --- a/define/openapi.go +++ b/define/openapi.go @@ -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。