-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript-axios] Fix Bearer authentication #2578
Conversation
It was generated the same as Basic authentication. Now we handle both cases differently. Fix OpenAPITools#1446
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
There does not seem to be any tests covering this yet, but I'm not sure where I could put it. Templates seem to be tested via the petstore samples, but it does not contain Bearer authentication. Is it ok to add it to the petstore (which means re-generating all the samples) ? Are there some other samples ? I'm open to suggestions for this. |
modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache
Outdated
Show resolved
Hide resolved
…tead of config.password As it is done in the angular client: https://github.com/OpenAPITools/openapi-generator/blob/0889b8ec1349d6f912ad7dfa221d3980f1801dba/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache#L213-L220
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
you could check if there is a separate petstore yaml file (e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml) that covers the case you want to test and use that to create separate samples, e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/bin/typescript-angular-v7-petstore-provided-in-root.sh#L30 |
Some samples seem to use the Should we replace the typescript-axios samples with the (thank you for your help BTW, I'm still discovering the internals of the project 🙂 ) |
good questions. to be honest: I don't know how to answer them. maybe @wing328 can give us a hint? |
PHP, Ruby and a few more have both Petstore samples (under different folders) for Petstore OAS v2, v3 spec. These generators have better support for new features in OAS v3 (e.g. nullable, allOf, etc) If the TS generators are supporting these new features, we should definitely generate the OAS v3 Petstore samples and create some integration tests accordingly. |
Description of the PR
[typescript-axios] Fix Bearer authentication
It was generated the same as Basic authentication. Now we handle both cases differently.
Fix #1446
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,. Default:3.4.x
,4.0.x
master
.Technical Committee
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10)