Add support for normalizing bearerAuth#20860
Conversation
|
we can give it a try. definitely something the normalizer can help in this case will you be able to maintain this feature/normalizer rule moving forward? and what about updating the spec to v3.x instead? thanks for submitting a PR to start with |
|
I hope future versions of the spec move to openapi 3.x, but I can't change this one unfortunately. I'm definitely willing to maintain this if anything comes up with it. It is now updated with doc updates and a test for the new feature. I did change the name from |
|
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
The openapi 2.0 spec did not support bearer authentication but it was added in openapi 3.0. In order to support client generation that includes support for bearerAuth, this change adds a new feature to the OpenapiNormalizer so that it can be configured to look for a specific securityDefinition name and convert it to bearerAuth.
|
Thanks for the heads up. I believe I have corrected that now by resetting the author using the correct email address. |
|
thanks for the PR. let's give it a try |
Putting this up to help clarify my feature request in #20842. I wanted to see if something like this would be considered. If so, I will proceed and add unit tests and documentation to get the PR ready for review. If not, I'll go the direction of putting this into a user defined template instead.
The openapi 2.0 spec did not support bearer authentication but it was added in openapi 3.0. In order to support client generation that includes support for bearerAuth, this change adds a new feature to the OpenapiNormalizer so that it can be configured to look for a specific securityDefinition name and convert it to bearerAuth.
Example:
openapi-generator-cli config file includes:
Original spec includes:
Generated spec has:
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)