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

pull out onChange handler for #input_apiKey so it can be called manually #594

Merged
merged 2 commits into from
Sep 26, 2014

Conversation

alexagranov
Copy link
Contributor

Hi there. One feature clients have really loved is the ability to exercise the API endpoints with a prepopulated ApiKey if the API is protected with one. This comes in really handy for marketing purposes - people can play around in a sandbox environment before going through the process of getting a real ApiKey.

Before the introduction of the ApiKeyAuthorization class, setting the 'apiKey' property when creating SwaggerUi would pre-populate the 'api_key' input and then I just had to use that for generated API calls.

ApiKeyAuthorization is sweet but I'm wondering if we can just pull out the handler for change() on the 'api_key' input so that we can call it after code that sets the 'api_key' value manually? This is needed since the change() event doesn't fire unless focus is lost on an input - which it doesn't have in this case. I left in sample commented-out code that shows this.

What do you think?

@fehguy
Copy link
Contributor

fehguy commented Sep 20, 2014

Hi, I think that's reasonable to do. Are you using the default index.html of swagger for your app? I'm wondering if this isn't something that should live in your (custom?) index.html.

@alexagranov
Copy link
Contributor Author

I'm actually using grape-swagger-ui which just uses index.html as a
template but they pull it from swagger-ui.

Thanks for getting back so fast!
On Sep 20, 2014 12:15 PM, "Tony Tam" [email protected] wrote:

Hi, I think that's reasonable to do. Are you using the default index.html
of swagger for your app? I'm wondering if this isn't something that should
live in your (custom?) index.html.


Reply to this email directly or view it on GitHub
#594 (comment).

fehguy added a commit that referenced this pull request Sep 26, 2014
pull out onChange handler for #input_apiKey so it can be called manually
@fehguy fehguy merged commit b9e79d6 into swagger-api:master Sep 26, 2014
Jonahss pushed a commit to eaze/swagger-ui that referenced this pull request Aug 12, 2016
pull out onChange handler for #input_apiKey so it can be called manually
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this pull request Aug 18, 2016
pull out onChange handler for #input_apiKey so it can be called manually
JuanSW18 pushed a commit to Digital-Paw/digital-paw-swagger-ui that referenced this pull request Aug 23, 2024
pull out onChange handler for #input_apiKey so it can be called manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants