From 6fb2f68a0211b8a8a7264fe13d9b71407ead0d3d Mon Sep 17 00:00:00 2001 From: Zodial Date: Wed, 18 Oct 2023 14:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dswagger=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=83=A8=E5=88=86=E5=8F=82=E6=95=B0=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- console/commands/swagger.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console/commands/swagger.go b/console/commands/swagger.go index a6b240b..1e964cb 100644 --- a/console/commands/swagger.go +++ b/console/commands/swagger.go @@ -401,7 +401,8 @@ func messageToSchemas(pge string, message parser.Message, swagger *openapi.Spec) if isProtoBaseType(option.Ty) { // 基础类型的数组 attr := &openapi.Schema{ - Type: "array", + Type: "array", + Description: doc, Items: &openapi.Schema{ Description: doc, Type: getProtoToSwagger(option.Ty), @@ -421,7 +422,8 @@ func messageToSchemas(pge string, message parser.Message, swagger *openapi.Spec) } else { // 引用其他对象 attr := &openapi.Schema{ - Type: "array", + Type: "array", + Description: doc, Items: &openapi.Schema{ Ref: getRef(pge, option.Ty), Description: doc,