feat: 支持设置公共的请求参数
This commit is contained in:
@@ -53,6 +53,21 @@ func TestGenerate_AddApiDoc(t *testing.T) {
|
||||
In: strings.ToLower(consts.RequestDataLocationHeader.String()),
|
||||
},
|
||||
},
|
||||
}), WithCommonParameter(&openapi3.ParametersMap{
|
||||
"Token": {
|
||||
Value: &openapi3.Parameter{
|
||||
Name: "Token",
|
||||
In: strings.ToLower(consts.RequestDataLocationHeader.String()),
|
||||
Description: "用户登录 Token",
|
||||
},
|
||||
},
|
||||
"User-Agent": {
|
||||
Value: &openapi3.Parameter{
|
||||
Name: "User-Agent",
|
||||
In: strings.ToLower(consts.RequestDataLocationHeader.String()),
|
||||
Description: "用户访问 UA",
|
||||
},
|
||||
},
|
||||
}))
|
||||
DocManager.AddApiDoc(docFlag, define.UriConfig{
|
||||
Path: "/a/b/c",
|
||||
|
||||
Reference in New Issue
Block a user