Skip to content

fix: 修改结构体添加注释swaggerui不显示问题#123

Open
linabellbiu wants to merge 3 commits intozeromicro:mainfrom
linabellbiu:main
Open

fix: 修改结构体添加注释swaggerui不显示问题#123
linabellbiu wants to merge 3 commits intozeromicro:mainfrom
linabellbiu:main

Conversation

@linabellbiu
Copy link

对于非数组字段(如 AccountValidation)​:

​Swagger 2.0:

不能在同级使用 $ref 和 description。
​解决方法: 将描述移动到被引用的模型中(例如在 AccountValidation 中添加 description)。

"AccountValidation": {
  "type": "object",
  "description": "xxxxxxxxx",  // 在此处添加描述
  "properties": { ... }
}

修改前错误的描述方式:
image

修改后正确的描述方式:
image

@linabellbiu
Copy link
Author

@kevwan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant