gf icon indicating copy to clipboard operation
gf copied to clipboard

Post请求,Req结构字段定义`in:header`,仍会出现在body中,导致swagger或redoc出现两个相同字段

Open mingzaily opened this issue 2 years ago • 0 comments

1. What version of Go and system type/arch are you using?

go 1.17, mac

2. What version of GoFrame are you using?

v2.1.0-rc4

3. Can this issue be re-produced with the latest release?

yes

4. What did you do?

define
type GetUserReq struct {
	g.Meta `path:"/user" tags:"User" method:"post" sm:"获取用户信息"`
	Token  string `json:"token" v:"required" dc:"用户token" in:"header"`
	UserId int    `json:"user_id" v:"required" dc:"用户ID"`
}

type GetUserRes struct{}
open /swagger
image
open /api.json
image

5. What did you expect to see?

header param not in request body

6. What did you see instead?

header param in request body

mingzaily avatar Jun 16 '22 03:06 mingzaily

建议升级版本使用

houseme avatar Aug 11 '22 16:08 houseme