Skip to content

Where I supposed to set the api_key value in Java generated code ? #697

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

Closed
frodrigo opened this issue Apr 28, 2015 · 6 comments
Closed

Where I supposed to set the api_key value in Java generated code ? #697

frodrigo opened this issue Apr 28, 2015 · 6 comments

Comments

@frodrigo
Copy link
Contributor

Where I supposed to set the api_key value in Java generated code, when api_key set send as query parameter ?

@fehguy
Copy link
Contributor

fehguy commented Apr 28, 2015

Currently not supported, but will be added.

@karussell
Copy link
Contributor

See my simple and clean workaround: #684 or just define a separate query parameter in your specification

@xhh
Copy link
Contributor

xhh commented Jun 9, 2015

This has been implemented by #826, see here and here for examples of how to set API key.

@karussell
Copy link
Contributor

Thanks.

Still the static things are really ugly. For example Configuration: what we live in a perfect world and all APIs are implemented with swagger :) ? Then two APIs cannot use different keys or other config stuff with this approach!

@xhh
Copy link
Contributor

xhh commented Jun 9, 2015

@karussell as you can see in the constructor of ApiClient, authentications are stored within an ApiClient instance, so configurations of different ApiClient instances do not interfere with each other.

what's more, ApiClient/Configuration from different SDKs shall have different packages, for example, com.hello.ApiClient vs com.world.ApiClient, so why can't use different keys or other config stuff?

@karussell
Copy link
Contributor

Ah, okay. Maybe the docs are outdated. As in #826 I saw Configuration.setApiKey("special-key"); and assumed it that way.

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

No branches or pull requests

4 participants