Skip to content

Conversation

@wing328
Copy link
Contributor

@wing328 wing328 commented Oct 16, 2016

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

Add configuration object to support authentication (api key, HTTP basic, oauth)

cc @tht13

@wing328
Copy link
Contributor Author

wing328 commented Oct 17, 2016

TODO: use dictionary instead of string for apiKey

@tht13
Copy link
Contributor

tht13 commented Oct 18, 2016

@wing328 Do you have an example of where the apikey dictionary is implemented? I am trying to add this feature.

@wing328
Copy link
Contributor Author

wing328 commented Oct 18, 2016

@tht13
Copy link
Contributor

tht13 commented Oct 19, 2016

wing328#8 is a PR adding the dictionary functionality, we shall see if it passes the tests 😄

tht13 and others added 2 commits October 20, 2016 18:02
* 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
@tht13
Copy link
Contributor

tht13 commented Oct 20, 2016

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.

@wing328
Copy link
Contributor Author

wing328 commented Oct 20, 2016

@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.

@wing328 wing328 merged commit 9036dfd into swagger-api:2.3.0 Oct 20, 2016
@wing328
Copy link
Contributor Author

wing328 commented Oct 20, 2016

PR merged into master.

Thanks @tht13 for his contributions to make this happened.

@LeonLiuY
Copy link

LeonLiuY commented Aug 7, 2017

Hi, it won't compile if the api key name contains dash -.

I meet this problem.

@wing328
Copy link
Contributor Author

wing328 commented Aug 7, 2017

@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.

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