I'm not sure if this is a bug or I'm missing something but Swagger is not adding the "Authorization: .." header when executing a request
I have this un-authenticated endpoint
public String getUserFromAuth(
@Parameter(description = "Bearer token", required = true, name = "Authorization", in = ParameterIn.HEADER) @HeaderParam("Authorization") String authHeader
) {...}
When executing this request on Swagger the header is not added.
However if I change name = "Authorization"
to `name = "Authorization2" then in that case yes the Authorization2 header is added.
the swagger json config looks fine:
"parameters": [
{
"name": "Authorization",
"in": "header",
"description": "Bearer token",
"required": true,
"schema": {
"type": "string"
}
}
],
To simplify the issue I have removed all together the security
config so there is no confusion
Swagger-core: 2.1.13 Swgger-ui: 4.5.0