Skip to content
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

Merged
merged 2 commits into from
Apr 4, 2019

Conversation

hectorj
Copy link
Contributor

@hectorj hectorj commented Apr 2, 2019

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

  • Read the contribution guidelines.
  • Ran the shell script under ./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\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

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)

It was generated the same as Basic authentication. Now we handle both cases differently.

Fix OpenAPITools#1446
@auto-labeler
Copy link

auto-labeler bot commented Apr 2, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@hectorj
Copy link
Contributor Author

hectorj commented Apr 2, 2019

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.

Copy link
Member

@macjohnny macjohnny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@macjohnny
Copy link
Member

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.

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

@hectorj
Copy link
Contributor Author

hectorj commented Apr 3, 2019

Some samples seem to use the 2_0 petstore while some others use the 3_0. I don't think I saw any language using both. How is it chosen ?

Should we replace the typescript-axios samples with the 3_0 version or add it as a new sample ?
If we add it as new, do we want to redo all of them (with the various options), or just the default one ?

(thank you for your help BTW, I'm still discovering the internals of the project 🙂 )

@macjohnny
Copy link
Member

good questions. to be honest: I don't know how to answer them.

maybe @wing328 can give us a hint?

@wing328
Copy link
Member

wing328 commented Apr 4, 2019

Some samples seem to use the 2_0 petstore while some others use the 3_0. I don't think I saw any language using both. How is it chosen ?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants