无法在 Swagger UI 的标头中传递 JWT 令牌。已经尝试过 API,它工作正常。
下面是 CORS 的代码片段
handleCORS := cors.Default().Handler
return handleCORS(handler)
}```
Used the below codes for swagger in the respective handler
```// consumes:`enter code here`
// -application/json
// swagger:parameters getticket3
type ticketsParams2Wrapper struct {
// Get ticket by id
// in: path
// required: true
//type:application/json
ID string `json:"id,omitempty" bson:"id,omitempty"`
// an authorization header
// in:header
// required: true
// type:string
Token string