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

Feature/pass api key to swagger - closes #76 #534

Merged
merged 6 commits into from
Oct 20, 2015

Conversation

frenchbread
Copy link
Contributor

No description provided.

@frenchbread frenchbread changed the title Feature/pass api key to swagger Feature/pass api key to swagger - closes #76 Oct 19, 2015
@frenchbread
Copy link
Contributor Author

#76 related issue. @apinf/developers Please review

@mauriciovieira mauriciovieira self-assigned this Oct 19, 2015
@@ -29,6 +29,17 @@ Template.documentation.events({

// Set Swagger document URL to selected value
instance.swaggerDocumentUrl.set(event.target.value);
},
'load #documentation': function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try to adhere to some conventions, like use ' or " to name the events.
As the other events and helpers are using ", I suggest replacing ' for ".

@mauriciovieira
Copy link
Contributor

After these tiny changes, 👍, feel free to merge.

@frenchbread
Copy link
Contributor Author

@mauriciovieira Thanks!

frenchbread added a commit that referenced this pull request Oct 20, 2015
Feature/pass api key to swagger - closes #76
@frenchbread frenchbread merged commit 8676103 into develop Oct 20, 2015
@frenchbread frenchbread deleted the feature/pass-api-key-to-swagger branch October 20, 2015 11:40
@brylie
Copy link
Contributor

brylie commented Oct 26, 2015

@mauriciovieira is there any way I can help here?

@mauriciovieira
Copy link
Contributor

@brylie I think it is done

@frenchbread
Copy link
Contributor Author

@brylie Actually I came up with better solution for this issue after stated working on #517.

In public/swagger/index.html there are commented out lines:

// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
 /*
    var apiKey = "myApiKeyXXXX123456789";
    $('#input_apiKey').val(apiKey);
*/

This would be the best place to preload user's api key. The thing is that Swagger UI is currently loaded using iframe in client/views/documentation/view/documentation.html

<iframe src="/swagger/index.html?url={{ swaggerDocumentUrl }}" width="100%" id="documentation"></iframe>

Meaning that file index.html which I mentioned above is not used at all, so approach that I am suggesting is not suitable.

In addition, it would be also possible to change path (e.g. url) to swagger.json file (line 30 in public/swagger/index.html)

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.

None yet

3 participants