Authorization header
See original GitHub issueWDYT in having something like:
openapi3.js around line 136
if ('bearerAuth' in data.api.components.securitySchemes) {
var authorization = {};
authorization.name = 'Authorization';
authorization.type = 'string';
authorization.in = 'header';
authorization.exampleValues = {};
authorization.exampleValues.json = "'Bearer {access_token}'";
authorization.exampleValues.object = ['Bearer {access_token}'];
data.allHeaders.push(authorization);
}
That way the code examples would be more complete since the generated header would include the required authorization header.
e.g
curl -X POST https://x.com/activate \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}'
instead of
curl -X POST https://x.com/activate \
-H 'Accept: application/json'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Authorization - HTTP - MDN Web Docs - Mozilla
The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a ......
Read more >Basic access authentication - Wikipedia
In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic <credentials> , where credentials is the Base64...
Read more >Http authorization header entity definition - Microsoft Learn
An authorization header used in HTTP request. Pattern. Various authentication header formats for example: authorization: basic ********
Read more >HTTP headers | Authorization - GeeksforGeeks
The HTTP headers Authorization header is a request type header that used to contains the credentials information to authenticate a user ...
Read more >Bearer Authentication - Swagger
The client must send this token in the Authorization header when making requests to protected resources: Authorization: Bearer <token>.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@trev @alexanderkjeldaas @luigi-riefolo I’ve added code to generate an
Authorizationheader where the securityScheme is eitherhttpwith thebearerscheme, orauth2oropenIdConnect.If you can test from the GitHub repository, that would be great, otherwise these changes will be published as part of Widdershins v3.1.0
I like it! Do you want to work up a PR based on the code above? I think you’d need to detect the
type: httpandscheme: bearerof the securityScheme referenced by the operation or the default Security Requirement Object.