1

Unable to pass the JWT token in the header in the Swagger UI.Have tried API, its working fine.

Below is the code snippet for 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

Below is the screenshot of the issue occurring

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197

0 Answers0