Skip to content

Commit

Permalink
Support for changing api_key parameter name. Closes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush committed Jul 18, 2012
1 parent 4a54c7a commit a77e617
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 41 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ _Note that for POST/PUT body, you'd need to paste in the request data in an appr
### Header Parameters
header parameters aere supported. However because of [Cross-Origin Resource Sharing](http://www.w3.org/TR/cors/) restrictions, swagger-ui, by default, does not send header parameters. This can be enabled by [setting the supportHeaderParams to false when creating SwaggerUI instance](https://github.com/wordnik/swagger-ui/blob/f2e63c65a759421aad590b7275371cd0c06c74ea/src/main/html/index.html#L48).

### Api Key Parameter
If you enter an api key in swagger-ui, it sends a parameter named 'api_key' as a query (or as a header param if you've enabled it as described above). You may not want to use the name 'api_key' as the name of this parameter. You can change its name by setting the _apiKeyName_ parameter when you instantiate a SwaggerUI instance. For example to call it 'sessionId'

apiKeyName: "sessionId"

How to Improve It
-----------------
Expand Down
19 changes: 6 additions & 13 deletions dist/lib/swagger.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions dist/swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,18 +773,16 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da



// Generated by CoffeeScript 1.3.1
// Generated by CoffeeScript 1.3.3
(function() {
var HeaderView, MainView, OperationView, ParameterView, ResourceView, SwaggerUi,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

SwaggerUi = (function(_super) {

__extends(SwaggerUi, _super);

SwaggerUi.name = 'SwaggerUi';

function SwaggerUi() {
return SwaggerUi.__super__.constructor.apply(this, arguments);
}
Expand Down Expand Up @@ -892,8 +890,6 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da

__extends(HeaderView, _super);

HeaderView.name = 'HeaderView';

function HeaderView() {
return HeaderView.__super__.constructor.apply(this, arguments);
}
Expand Down Expand Up @@ -960,8 +956,6 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da

__extends(MainView, _super);

MainView.name = 'MainView';

function MainView() {
return MainView.__super__.constructor.apply(this, arguments);
}
Expand Down Expand Up @@ -1002,8 +996,6 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da

__extends(ResourceView, _super);

ResourceView.name = 'ResourceView';

function ResourceView() {
return ResourceView.__super__.constructor.apply(this, arguments);
}
Expand Down Expand Up @@ -1039,8 +1031,6 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da

__extends(OperationView, _super);

OperationView.name = 'OperationView';

function OperationView() {
return OperationView.__super__.constructor.apply(this, arguments);
}
Expand Down Expand Up @@ -1197,8 +1187,6 @@ templates['resource'] = template(function (Handlebars,depth0,helpers,partials,da

__extends(ParameterView, _super);

ParameterView.name = 'ParameterView';

function ParameterView() {
return ParameterView.__super__.constructor.apply(this, arguments);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/swagger-ui.min.js

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions lib/swagger.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a77e617

Please sign in to comment.