Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api中添加go的参数校验器时,生成swagger文件的name不正确。 #60

Open
anyone0034 opened this issue Nov 15, 2022 · 0 comments

Comments

@anyone0034
Copy link

这是我定义的api文件

DefineListReq{
Page int form:"page,default=1" // 选填,页码
Size int form:"size,default=10" validate:"uint|num|min:1" message:"num:页码必须是数字|min:每页显示条数,必须大于或等于1" // 选填,每页显示条数
DefineKey string form:"define_key" filter:"trim" // 选填,define_key
}

生成的swagger文件

"/api/handle/event/define/list": {
"get": {
"summary": "分类列表",
"operationId": "DefineList",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/DefineListResp"
}
}
},
"parameters": [
{
"name": "page",
"description": " 选填,页码",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": "1"
},
{
"name": "num:页码必须是数字|min:每页显示条数,必须大于或等于1",
"description": " 选填,每页显示条数",
"in": "query",
"required": true,
"type": "integer",
"format": "int32",
"default": "10"
},
{
"name": "trim",
"description": " 选填,define_key",
"in": "query",
"required": true,
"type": "string"
}
],
"requestBody": {},
"tags": [
"event/define"
]
}
}

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

No branches or pull requests

1 participant