Expected behavior
I already set @securityDefinitions.apikey ApiKeyAuth in General API info, and @Security ApiKeyAuth in Each API operation:
@securityDefinitions.apikey ApiKeyAuth
func main() {
}
// @Security ApiKeyAuth
// @router /account/info [get]
func GetAccountInfo(c *gin.Context) {
}
This works great, except that Swagger UI says there is no params needed:

This is not correct since Authorization header is needed for the API. After I add @param definition to API:
// @Security ApiKeyAuth
// @param Authorization header string true "Authorization"
// @router /account/info [get]
func GetAccountInfo(c *gin.Context) {
}
Now, Swagger UI is correct:


But Authorization header is empty when trying out the API.
Is there any way to auto set Authorization header that already set by ApiKeyAuth?
Your swag version
1.4.1
push auth button in swagger ui

Done.

example is here.
https://github.com/swaggo/swag/tree/master/example/celler
@fannheyward
If you have problem reopen issue.
@pei0804 Does this work for Oauth2Implicit ? It doesn't seem to be sending my Authorization Header after I Authenticate
Most helpful comment
Difine
https://github.com/swaggo/swag/blob/934068ff10f3d59cc4c91e9726eb4f5530093107/example/celler/main.go#L33-L35
Use
https://github.com/swaggo/swag/blob/e5d83e9840f5f169ccfa779899f03478e6d6973a/example/celler/controller/admin.go#L24
push auth button in swagger ui

Done.

example is here.
https://github.com/swaggo/swag/tree/master/example/celler
@fannheyward