merged pr for https://github.com/wordnik/swagger-js/pull/54
This commit is contained in:
45
dist/lib/swagger.js
vendored
45
dist/lib/swagger.js
vendored
@@ -1,10 +1,9 @@
|
||||
// Generated by CoffeeScript 1.4.0
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
SwaggerApi = (function() {
|
||||
|
||||
SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";
|
||||
|
||||
SwaggerApi.prototype.debug = false;
|
||||
@@ -110,6 +109,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if (response.basePath) {
|
||||
this.basePath = response.basePath;
|
||||
} else if (this.url.indexOf('?') > 0) {
|
||||
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
|
||||
} else {
|
||||
this.basePath = this.url;
|
||||
}
|
||||
if (isApi) {
|
||||
newName = response.resourcePath.replace(/\//g, '');
|
||||
this.resourcePath = response.resourcePath;
|
||||
@@ -117,13 +123,6 @@
|
||||
this.apis[newName] = res;
|
||||
this.apisArray.push(res);
|
||||
} else {
|
||||
if (response.basePath) {
|
||||
this.basePath = response.basePath;
|
||||
} else if (this.url.indexOf('?') > 0) {
|
||||
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
|
||||
} else {
|
||||
this.basePath = this.url;
|
||||
}
|
||||
_ref2 = response.apis;
|
||||
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
||||
resource = _ref2[_k];
|
||||
@@ -162,6 +161,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if (response.basePath) {
|
||||
this.basePath = response.basePath;
|
||||
} else if (this.url.indexOf('?') > 0) {
|
||||
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
|
||||
} else {
|
||||
this.basePath = this.url;
|
||||
}
|
||||
if (isApi) {
|
||||
newName = response.resourcePath.replace(/\//g, '');
|
||||
this.resourcePath = response.resourcePath;
|
||||
@@ -169,13 +175,6 @@
|
||||
this.apis[newName] = res;
|
||||
this.apisArray.push(res);
|
||||
} else {
|
||||
if (response.basePath) {
|
||||
this.basePath = response.basePath;
|
||||
} else if (this.url.indexOf('?') > 0) {
|
||||
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
|
||||
} else {
|
||||
this.basePath = this.url;
|
||||
}
|
||||
_ref2 = response.apis;
|
||||
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
||||
resource = _ref2[_k];
|
||||
@@ -222,7 +221,7 @@
|
||||
for (resource_name in _ref) {
|
||||
resource = _ref[resource_name];
|
||||
for (modelName in resource.models) {
|
||||
if (!(this.models[modelName] != null)) {
|
||||
if (this.models[modelName] == null) {
|
||||
this.models[modelName] = resource.models[modelName];
|
||||
this.modelsArray.push(resource.models[modelName]);
|
||||
}
|
||||
@@ -262,7 +261,6 @@
|
||||
})();
|
||||
|
||||
SwaggerResource = (function() {
|
||||
|
||||
SwaggerResource.prototype.api = null;
|
||||
|
||||
SwaggerResource.prototype.produces = null;
|
||||
@@ -351,7 +349,7 @@
|
||||
var model, modelName, swaggerModel, _i, _len, _ref, _results;
|
||||
if (models != null) {
|
||||
for (modelName in models) {
|
||||
if (!(this.models[modelName] != null)) {
|
||||
if (this.models[modelName] == null) {
|
||||
swaggerModel = new SwaggerModel(modelName, models[modelName]);
|
||||
this.modelsArray.push(swaggerModel);
|
||||
this.models[modelName] = swaggerModel;
|
||||
@@ -444,7 +442,6 @@
|
||||
})();
|
||||
|
||||
SwaggerModel = (function() {
|
||||
|
||||
function SwaggerModel(modelName, obj) {
|
||||
var prop, propertyName, value;
|
||||
this.name = obj.id != null ? obj.id : modelName;
|
||||
@@ -527,7 +524,6 @@
|
||||
})();
|
||||
|
||||
SwaggerModelProperty = (function() {
|
||||
|
||||
function SwaggerModelProperty(name, obj) {
|
||||
this.name = name;
|
||||
this.dataType = obj.type || obj.dataType || obj["$ref"];
|
||||
@@ -599,7 +595,6 @@
|
||||
})();
|
||||
|
||||
SwaggerOperation = (function() {
|
||||
|
||||
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,
|
||||
_this = this;
|
||||
@@ -615,7 +610,6 @@
|
||||
this.consumes = consumes;
|
||||
this.produces = produces;
|
||||
this["do"] = __bind(this["do"], this);
|
||||
|
||||
if (this.nickname == null) {
|
||||
this.resource.api.fail("SwaggerOperations must have a nickname.");
|
||||
}
|
||||
@@ -915,7 +909,6 @@
|
||||
})();
|
||||
|
||||
SwaggerRequest = (function() {
|
||||
|
||||
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,
|
||||
_this = this;
|
||||
@@ -1106,7 +1099,6 @@
|
||||
})();
|
||||
|
||||
SwaggerHttp = (function() {
|
||||
|
||||
SwaggerHttp.prototype.Shred = null;
|
||||
|
||||
SwaggerHttp.prototype.shred = null;
|
||||
@@ -1151,7 +1143,6 @@
|
||||
})();
|
||||
|
||||
SwaggerAuthorizations = (function() {
|
||||
|
||||
SwaggerAuthorizations.prototype.authz = null;
|
||||
|
||||
function SwaggerAuthorizations() {
|
||||
@@ -1179,7 +1170,6 @@
|
||||
})();
|
||||
|
||||
ApiKeyAuthorization = (function() {
|
||||
|
||||
ApiKeyAuthorization.prototype.type = null;
|
||||
|
||||
ApiKeyAuthorization.prototype.name = null;
|
||||
@@ -1210,7 +1200,6 @@
|
||||
})();
|
||||
|
||||
PasswordAuthorization = (function() {
|
||||
|
||||
PasswordAuthorization.prototype.name = null;
|
||||
|
||||
PasswordAuthorization.prototype.username = null;
|
||||
|
||||
Reference in New Issue
Block a user