-
Notifications
You must be signed in to change notification settings - Fork 6k
[Typscript][Fetch] add configuration to support authentication #4008
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
Conversation
|
TODO: use dictionary instead of string for apiKey |
|
@wing328 Do you have an example of where the apikey dictionary is implemented? I am trying to add this feature. |
|
wing328#8 is a PR adding the dictionary functionality, we shall see if it passes the tests 😄 |
* Add dictionary to store apikeys * Type apikey with expected params rather than Dictionary - typescript-fetch * Update test samples to new typescript-fetch api * Fix tests for typesript-fetch api
|
Rather than use a Dictionary, I instead just defined the expected names of the api keys as an object. Makes it easier for the user when it comes to intellisense and the such. They don't have to look in the swagger.yaml file or generated api.ts to see what the exact name of the expected key is. |
|
@tht13 that's perfectly fine with me and I'm sure Typescript developers would appreciate the enhancement you've made to the Typescript-fetch API clients. |
|
PR merged into master. Thanks @tht13 for his contributions to make this happened. |
|
Hi, it won't compile if the api key name contains dash I meet this problem. |
|
@liuyang1204 please open a new issue for tracking with the error message showing which line is causing the problem. There's another PR to improve TS Fetch: #6130. Please review when you've time. |
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
Add
configurationobject to support authentication (api key, HTTP basic, oauth)cc @tht13