There is an issue with parsing the comments in the API file content
Describe the bug There is an issue with parsing the comments in the API file content. Some comments that do not belong to the parameter will be forcibly added to the comments for that parameter.
To Reproduce Steps to reproduce the behavior, if applicable:
-
The code is
type ( //注册请求结构 RegisterReq { Username string `json:"username"` Password string `json:"password"` Mobile string `json:"mobile"` } //备注 // ------------- 不必要的注释,不是LoginReq的注释,仅仅是分割线 --------- //登录请求 LoginReq { Username string `json:"username"` //测试 Password string `json:"password"` //测试2 }
)
2. The error is
```json
"/api/user/login": {
"post": {
"summary": "登录",
"operationId": "login",
"responses": {
"200": {
"description": "A successful response.",
"schema": {}
}
},
"parameters": [
{
"name": "body",
"description": "备注, ------------- 不必要的注释,不是LoginReq的注释,仅仅是分割线 ---------,登录请求",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/LoginReq"
}
}
],
"tags": [
"user-api"
]
}
},
Expected behavior The real comments should be distinguished by the blank lines in the "xxx.api" file, instead of treating all comment contents as comments.
Screenshots

Environments (please complete the following information):
- OS: [e.g. macOS]
- go-zero version [e.g. 1.5.3]
- goctl version [e.g. 1.5.3, optional]
More description I hope this issue can be quickly resolved.
goctl-swagger‘s issue?
goctl-swagger‘s issue?
no, to be precise, it is the issue of goctl, because the data used by goctl swagger is data from the goctl parsing API file.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.