This commit is contained in:
Tony Tam
2013-09-16 14:54:36 -07:00
parent 929f8b61f2
commit 3347d7e9fd
4 changed files with 97 additions and 119 deletions

45
dist/lib/swagger.js vendored
View File

@@ -1,10 +1,9 @@
// Generated by CoffeeScript 1.4.0 // Generated by CoffeeScript 1.6.3
(function() { (function() {
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource, var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
SwaggerApi = (function() { SwaggerApi = (function() {
SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json"; SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";
SwaggerApi.prototype.debug = false; SwaggerApi.prototype.debug = false;
@@ -110,13 +109,6 @@
} }
} }
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
if (response.basePath) { if (response.basePath) {
this.basePath = response.basePath; this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) { } else if (this.url.indexOf('?') > 0) {
@@ -124,6 +116,13 @@
} else { } else {
this.basePath = this.url; this.basePath = this.url;
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
_ref2 = response.apis; _ref2 = response.apis;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
resource = _ref2[_k]; resource = _ref2[_k];
@@ -162,13 +161,6 @@
} }
} }
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
if (response.basePath) { if (response.basePath) {
this.basePath = response.basePath; this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) { } else if (this.url.indexOf('?') > 0) {
@@ -176,6 +168,13 @@
} else { } else {
this.basePath = this.url; this.basePath = this.url;
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
_ref2 = response.apis; _ref2 = response.apis;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
resource = _ref2[_k]; resource = _ref2[_k];
@@ -222,7 +221,7 @@
for (resource_name in _ref) { for (resource_name in _ref) {
resource = _ref[resource_name]; resource = _ref[resource_name];
for (modelName in resource.models) { for (modelName in resource.models) {
if (!(this.models[modelName] != null)) { if (this.models[modelName] == null) {
this.models[modelName] = resource.models[modelName]; this.models[modelName] = resource.models[modelName];
this.modelsArray.push(resource.models[modelName]); this.modelsArray.push(resource.models[modelName]);
} }
@@ -262,7 +261,6 @@
})(); })();
SwaggerResource = (function() { SwaggerResource = (function() {
SwaggerResource.prototype.api = null; SwaggerResource.prototype.api = null;
SwaggerResource.prototype.produces = null; SwaggerResource.prototype.produces = null;
@@ -351,7 +349,7 @@
var model, modelName, swaggerModel, _i, _len, _ref, _results; var model, modelName, swaggerModel, _i, _len, _ref, _results;
if (models != null) { if (models != null) {
for (modelName in models) { for (modelName in models) {
if (!(this.models[modelName] != null)) { if (this.models[modelName] == null) {
swaggerModel = new SwaggerModel(modelName, models[modelName]); swaggerModel = new SwaggerModel(modelName, models[modelName]);
this.modelsArray.push(swaggerModel); this.modelsArray.push(swaggerModel);
this.models[modelName] = swaggerModel; this.models[modelName] = swaggerModel;
@@ -444,7 +442,6 @@
})(); })();
SwaggerModel = (function() { SwaggerModel = (function() {
function SwaggerModel(modelName, obj) { function SwaggerModel(modelName, obj) {
var prop, propertyName, value; var prop, propertyName, value;
this.name = obj.id != null ? obj.id : modelName; this.name = obj.id != null ? obj.id : modelName;
@@ -527,7 +524,6 @@
})(); })();
SwaggerModelProperty = (function() { SwaggerModelProperty = (function() {
function SwaggerModelProperty(name, obj) { function SwaggerModelProperty(name, obj) {
this.name = name; this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"]; this.dataType = obj.type || obj.dataType || obj["$ref"];
@@ -599,7 +595,6 @@
})(); })();
SwaggerOperation = (function() { SwaggerOperation = (function() {
function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) { function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) {
var parameter, v, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, var parameter, v, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3,
_this = this; _this = this;
@@ -615,7 +610,6 @@
this.consumes = consumes; this.consumes = consumes;
this.produces = produces; this.produces = produces;
this["do"] = __bind(this["do"], this); this["do"] = __bind(this["do"], this);
if (this.nickname == null) { if (this.nickname == null) {
this.resource.api.fail("SwaggerOperations must have a nickname."); this.resource.api.fail("SwaggerOperations must have a nickname.");
} }
@@ -915,7 +909,6 @@
})(); })();
SwaggerRequest = (function() { SwaggerRequest = (function() {
function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) { function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) {
var body, e, fields, headers, key, myHeaders, name, obj, param, parent, possibleParams, requestContentType, responseContentType, urlEncoded, value, values, var body, e, fields, headers, key, myHeaders, name, obj, param, parent, possibleParams, requestContentType, responseContentType, urlEncoded, value, values,
_this = this; _this = this;
@@ -1106,7 +1099,6 @@
})(); })();
SwaggerHttp = (function() { SwaggerHttp = (function() {
SwaggerHttp.prototype.Shred = null; SwaggerHttp.prototype.Shred = null;
SwaggerHttp.prototype.shred = null; SwaggerHttp.prototype.shred = null;
@@ -1151,7 +1143,6 @@
})(); })();
SwaggerAuthorizations = (function() { SwaggerAuthorizations = (function() {
SwaggerAuthorizations.prototype.authz = null; SwaggerAuthorizations.prototype.authz = null;
function SwaggerAuthorizations() { function SwaggerAuthorizations() {
@@ -1179,7 +1170,6 @@
})(); })();
ApiKeyAuthorization = (function() { ApiKeyAuthorization = (function() {
ApiKeyAuthorization.prototype.type = null; ApiKeyAuthorization.prototype.type = null;
ApiKeyAuthorization.prototype.name = null; ApiKeyAuthorization.prototype.name = null;
@@ -1210,7 +1200,6 @@
})(); })();
PasswordAuthorization = (function() { PasswordAuthorization = (function() {
PasswordAuthorization.prototype.name = null; PasswordAuthorization.prototype.name = null;
PasswordAuthorization.prototype.username = null; PasswordAuthorization.prototype.username = null;

124
dist/swagger-ui.js vendored
View File

@@ -1182,18 +1182,18 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
// Generated by CoffeeScript 1.4.0 // Generated by CoffeeScript 1.6.3
(function() { (function() {
var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
__hasProp = {}.hasOwnProperty, __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) { SwaggerUi = (function(_super) {
__extends(SwaggerUi, _super); __extends(SwaggerUi, _super);
function SwaggerUi() { function SwaggerUi() {
return SwaggerUi.__super__.constructor.apply(this, arguments); _ref = SwaggerUi.__super__.constructor.apply(this, arguments);
return _ref;
} }
SwaggerUi.prototype.dom_id = "swagger_ui"; SwaggerUi.prototype.dom_id = "swagger_ui";
@@ -1215,7 +1215,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
this.dom_id = options.dom_id; this.dom_id = options.dom_id;
delete options.dom_id; delete options.dom_id;
} }
if (!($('#' + this.dom_id) != null)) { if ($('#' + this.dom_id) == null) {
$('body').append('<div id="' + this.dom_id + '"></div>'); $('body').append('<div id="' + this.dom_id + '"></div>');
} }
this.options = options; this.options = options;
@@ -1242,9 +1242,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
SwaggerUi.prototype.load = function() { SwaggerUi.prototype.load = function() {
var url, _ref; var url, _ref1;
if ((_ref = this.mainView) != null) { if ((_ref1 = this.mainView) != null) {
_ref.clear(); _ref1.clear();
} }
url = this.options.url; url = this.options.url;
if (url.indexOf("http") !== 0) { if (url.indexOf("http") !== 0) {
@@ -1322,11 +1322,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
window.SwaggerUi = SwaggerUi; window.SwaggerUi = SwaggerUi;
HeaderView = (function(_super) { HeaderView = (function(_super) {
__extends(HeaderView, _super); __extends(HeaderView, _super);
function HeaderView() { function HeaderView() {
return HeaderView.__super__.constructor.apply(this, arguments); _ref1 = HeaderView.__super__.constructor.apply(this, arguments);
return _ref1;
} }
HeaderView.prototype.events = { HeaderView.prototype.events = {
@@ -1384,21 +1384,21 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
MainView = (function(_super) { MainView = (function(_super) {
__extends(MainView, _super); __extends(MainView, _super);
function MainView() { function MainView() {
return MainView.__super__.constructor.apply(this, arguments); _ref2 = MainView.__super__.constructor.apply(this, arguments);
return _ref2;
} }
MainView.prototype.initialize = function() {}; MainView.prototype.initialize = function() {};
MainView.prototype.render = function() { MainView.prototype.render = function() {
var resource, _i, _len, _ref; var resource, _i, _len, _ref3;
$(this.el).html(Handlebars.templates.main(this.model)); $(this.el).html(Handlebars.templates.main(this.model));
_ref = this.model.apisArray; _ref3 = this.model.apisArray;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
resource = _ref[_i]; resource = _ref3[_i];
this.addResource(resource); this.addResource(resource);
} }
return this; return this;
@@ -1424,23 +1424,23 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ResourceView = (function(_super) { ResourceView = (function(_super) {
__extends(ResourceView, _super); __extends(ResourceView, _super);
function ResourceView() { function ResourceView() {
return ResourceView.__super__.constructor.apply(this, arguments); _ref3 = ResourceView.__super__.constructor.apply(this, arguments);
return _ref3;
} }
ResourceView.prototype.initialize = function() {}; ResourceView.prototype.initialize = function() {};
ResourceView.prototype.render = function() { ResourceView.prototype.render = function() {
var operation, _i, _len, _ref; var operation, _i, _len, _ref4;
console.log(this.model.description); console.log(this.model.description);
$(this.el).html(Handlebars.templates.resource(this.model)); $(this.el).html(Handlebars.templates.resource(this.model));
this.number = 0; this.number = 0;
_ref = this.model.operationsArray; _ref4 = this.model.operationsArray;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
operation = _ref[_i]; operation = _ref4[_i];
this.addOperation(operation); this.addOperation(operation);
} }
return this; return this;
@@ -1463,11 +1463,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
OperationView = (function(_super) { OperationView = (function(_super) {
__extends(OperationView, _super); __extends(OperationView, _super);
function OperationView() { function OperationView() {
return OperationView.__super__.constructor.apply(this, arguments); _ref4 = OperationView.__super__.constructor.apply(this, arguments);
return _ref4;
} }
OperationView.prototype.events = { OperationView.prototype.events = {
@@ -1480,7 +1480,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
OperationView.prototype.initialize = function() {}; OperationView.prototype.initialize = function() {};
OperationView.prototype.render = function() { OperationView.prototype.render = function() {
var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
isMethodSubmissionSupported = true; isMethodSubmissionSupported = true;
if (!isMethodSubmissionSupported) { if (!isMethodSubmissionSupported) {
this.model.isReadOnly = true; this.model.isReadOnly = true;
@@ -1505,9 +1505,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
contentTypeModel.consumes = this.model.consumes; contentTypeModel.consumes = this.model.consumes;
contentTypeModel.produces = this.model.produces; contentTypeModel.produces = this.model.produces;
_ref = this.model.parameters; _ref5 = this.model.parameters;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
param = _ref[_i]; param = _ref5[_i];
type = param.type || param.dataType; type = param.type || param.dataType;
if (type.toLowerCase() === 'file') { if (type.toLowerCase() === 'file') {
if (!contentTypeModel.consumes) { if (!contentTypeModel.consumes) {
@@ -1520,14 +1520,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
model: contentTypeModel model: contentTypeModel
}); });
$('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
_ref1 = this.model.parameters; _ref6 = this.model.parameters;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
param = _ref1[_j]; param = _ref6[_j];
this.addParameter(param, contentTypeModel.consumes); this.addParameter(param, contentTypeModel.consumes);
} }
_ref2 = this.model.responseMessages; _ref7 = this.model.responseMessages;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
statusCode = _ref2[_k]; statusCode = _ref7[_k];
this.addStatusCode(statusCode); this.addStatusCode(statusCode);
} }
return this; return this;
@@ -1554,7 +1554,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.submitOperation = function(e) { OperationView.prototype.submitOperation = function(e) {
var error_free, form, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; var error_free, form, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@@ -1578,23 +1578,23 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
opts = { opts = {
parent: this parent: this
}; };
_ref = form.find("input"); _ref5 = form.find("input");
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
o = _ref[_i]; o = _ref5[_i];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value; map[o.name] = o.value;
} }
} }
_ref1 = form.find("textarea"); _ref6 = form.find("textarea");
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
o = _ref1[_j]; o = _ref6[_j];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map["body"] = o.value; map["body"] = o.value;
} }
} }
_ref2 = form.find("select"); _ref7 = form.find("select");
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
o = _ref2[_k]; o = _ref7[_k];
val = this.getSelectedValue(o); val = this.getSelectedValue(o);
if ((val != null) && jQuery.trim(val).length > 0) { if ((val != null) && jQuery.trim(val).length > 0) {
map[o.name] = val; map[o.name] = val;
@@ -1612,14 +1612,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.getSelectedValue = function(select) { OperationView.prototype.getSelectedValue = function(select) {
var opt, options, _i, _len, _ref; var opt, options, _i, _len, _ref5;
if (!select.multiple) { if (!select.multiple) {
return select.value; return select.value;
} else { } else {
options = []; options = [];
_ref = select.options; _ref5 = select.options;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
opt = _ref[_i]; opt = _ref5[_i];
if (opt.selected) { if (opt.selected) {
options.push(opt.value); options.push(opt.value);
} }
@@ -1707,9 +1707,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
padding = ''; padding = '';
indent += transitions[fromTo]; indent += transitions[fromTo];
padding = ((function() { padding = ((function() {
var _j, _ref, _results; var _j, _ref5, _results;
_results = []; _results = [];
for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) { for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
_results.push(' '); _results.push(' ');
} }
return _results; return _results;
@@ -1774,11 +1774,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
StatusCodeView = (function(_super) { StatusCodeView = (function(_super) {
__extends(StatusCodeView, _super); __extends(StatusCodeView, _super);
function StatusCodeView() { function StatusCodeView() {
return StatusCodeView.__super__.constructor.apply(this, arguments); _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
return _ref5;
} }
StatusCodeView.prototype.initialize = function() {}; StatusCodeView.prototype.initialize = function() {};
@@ -1799,11 +1799,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ParameterView = (function(_super) { ParameterView = (function(_super) {
__extends(ParameterView, _super); __extends(ParameterView, _super);
function ParameterView() { function ParameterView() {
return ParameterView.__super__.constructor.apply(this, arguments); _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
return _ref6;
} }
ParameterView.prototype.initialize = function() {}; ParameterView.prototype.initialize = function() {};
@@ -1880,11 +1880,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
SignatureView = (function(_super) { SignatureView = (function(_super) {
__extends(SignatureView, _super); __extends(SignatureView, _super);
function SignatureView() { function SignatureView() {
return SignatureView.__super__.constructor.apply(this, arguments); _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
return _ref7;
} }
SignatureView.prototype.events = { SignatureView.prototype.events = {
@@ -1949,11 +1949,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ContentTypeView = (function(_super) { ContentTypeView = (function(_super) {
__extends(ContentTypeView, _super); __extends(ContentTypeView, _super);
function ContentTypeView() { function ContentTypeView() {
return ContentTypeView.__super__.constructor.apply(this, arguments); _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
return _ref8;
} }
ContentTypeView.prototype.initialize = function() {}; ContentTypeView.prototype.initialize = function() {};
@@ -1975,11 +1975,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ResponseContentTypeView = (function(_super) { ResponseContentTypeView = (function(_super) {
__extends(ResponseContentTypeView, _super); __extends(ResponseContentTypeView, _super);
function ResponseContentTypeView() { function ResponseContentTypeView() {
return ResponseContentTypeView.__super__.constructor.apply(this, arguments); _ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments);
return _ref9;
} }
ResponseContentTypeView.prototype.initialize = function() {}; ResponseContentTypeView.prototype.initialize = function() {};
@@ -2001,11 +2001,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ParameterContentTypeView = (function(_super) { ParameterContentTypeView = (function(_super) {
__extends(ParameterContentTypeView, _super); __extends(ParameterContentTypeView, _super);
function ParameterContentTypeView() { function ParameterContentTypeView() {
return ParameterContentTypeView.__super__.constructor.apply(this, arguments); _ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments);
return _ref10;
} }
ParameterContentTypeView.prototype.initialize = function() {}; ParameterContentTypeView.prototype.initialize = function() {};

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,9 @@
// Generated by CoffeeScript 1.4.0 // Generated by CoffeeScript 1.6.3
(function() { (function() {
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource, var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
SwaggerApi = (function() { SwaggerApi = (function() {
SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json"; SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";
SwaggerApi.prototype.debug = false; SwaggerApi.prototype.debug = false;
@@ -110,13 +109,6 @@
} }
} }
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
if (response.basePath) { if (response.basePath) {
this.basePath = response.basePath; this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) { } else if (this.url.indexOf('?') > 0) {
@@ -124,6 +116,13 @@
} else { } else {
this.basePath = this.url; this.basePath = this.url;
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
_ref2 = response.apis; _ref2 = response.apis;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
resource = _ref2[_k]; resource = _ref2[_k];
@@ -162,13 +161,6 @@
} }
} }
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
if (response.basePath) { if (response.basePath) {
this.basePath = response.basePath; this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) { } else if (this.url.indexOf('?') > 0) {
@@ -176,6 +168,13 @@
} else { } else {
this.basePath = this.url; this.basePath = this.url;
} }
if (isApi) {
newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
_ref2 = response.apis; _ref2 = response.apis;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
resource = _ref2[_k]; resource = _ref2[_k];
@@ -222,7 +221,7 @@
for (resource_name in _ref) { for (resource_name in _ref) {
resource = _ref[resource_name]; resource = _ref[resource_name];
for (modelName in resource.models) { for (modelName in resource.models) {
if (!(this.models[modelName] != null)) { if (this.models[modelName] == null) {
this.models[modelName] = resource.models[modelName]; this.models[modelName] = resource.models[modelName];
this.modelsArray.push(resource.models[modelName]); this.modelsArray.push(resource.models[modelName]);
} }
@@ -262,7 +261,6 @@
})(); })();
SwaggerResource = (function() { SwaggerResource = (function() {
SwaggerResource.prototype.api = null; SwaggerResource.prototype.api = null;
SwaggerResource.prototype.produces = null; SwaggerResource.prototype.produces = null;
@@ -351,7 +349,7 @@
var model, modelName, swaggerModel, _i, _len, _ref, _results; var model, modelName, swaggerModel, _i, _len, _ref, _results;
if (models != null) { if (models != null) {
for (modelName in models) { for (modelName in models) {
if (!(this.models[modelName] != null)) { if (this.models[modelName] == null) {
swaggerModel = new SwaggerModel(modelName, models[modelName]); swaggerModel = new SwaggerModel(modelName, models[modelName]);
this.modelsArray.push(swaggerModel); this.modelsArray.push(swaggerModel);
this.models[modelName] = swaggerModel; this.models[modelName] = swaggerModel;
@@ -444,7 +442,6 @@
})(); })();
SwaggerModel = (function() { SwaggerModel = (function() {
function SwaggerModel(modelName, obj) { function SwaggerModel(modelName, obj) {
var prop, propertyName, value; var prop, propertyName, value;
this.name = obj.id != null ? obj.id : modelName; this.name = obj.id != null ? obj.id : modelName;
@@ -527,7 +524,6 @@
})(); })();
SwaggerModelProperty = (function() { SwaggerModelProperty = (function() {
function SwaggerModelProperty(name, obj) { function SwaggerModelProperty(name, obj) {
this.name = name; this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"]; this.dataType = obj.type || obj.dataType || obj["$ref"];
@@ -599,7 +595,6 @@
})(); })();
SwaggerOperation = (function() { SwaggerOperation = (function() {
function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) { function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) {
var parameter, v, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, var parameter, v, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3,
_this = this; _this = this;
@@ -615,7 +610,6 @@
this.consumes = consumes; this.consumes = consumes;
this.produces = produces; this.produces = produces;
this["do"] = __bind(this["do"], this); this["do"] = __bind(this["do"], this);
if (this.nickname == null) { if (this.nickname == null) {
this.resource.api.fail("SwaggerOperations must have a nickname."); this.resource.api.fail("SwaggerOperations must have a nickname.");
} }
@@ -915,7 +909,6 @@
})(); })();
SwaggerRequest = (function() { SwaggerRequest = (function() {
function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) { function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) {
var body, e, fields, headers, key, myHeaders, name, obj, param, parent, possibleParams, requestContentType, responseContentType, urlEncoded, value, values, var body, e, fields, headers, key, myHeaders, name, obj, param, parent, possibleParams, requestContentType, responseContentType, urlEncoded, value, values,
_this = this; _this = this;
@@ -1106,7 +1099,6 @@
})(); })();
SwaggerHttp = (function() { SwaggerHttp = (function() {
SwaggerHttp.prototype.Shred = null; SwaggerHttp.prototype.Shred = null;
SwaggerHttp.prototype.shred = null; SwaggerHttp.prototype.shred = null;
@@ -1151,7 +1143,6 @@
})(); })();
SwaggerAuthorizations = (function() { SwaggerAuthorizations = (function() {
SwaggerAuthorizations.prototype.authz = null; SwaggerAuthorizations.prototype.authz = null;
function SwaggerAuthorizations() { function SwaggerAuthorizations() {
@@ -1179,7 +1170,6 @@
})(); })();
ApiKeyAuthorization = (function() { ApiKeyAuthorization = (function() {
ApiKeyAuthorization.prototype.type = null; ApiKeyAuthorization.prototype.type = null;
ApiKeyAuthorization.prototype.name = null; ApiKeyAuthorization.prototype.name = null;
@@ -1210,7 +1200,6 @@
})(); })();
PasswordAuthorization = (function() { PasswordAuthorization = (function() {
PasswordAuthorization.prototype.name = null; PasswordAuthorization.prototype.name = null;
PasswordAuthorization.prototype.username = null; PasswordAuthorization.prototype.username = null;