Commit cc490934 authored by Tony Tam's avatar Tony Tam
Browse files

updated swagger-js versions

parent b336076a
This diff is collapsed.
// swagger.js
// version 2.0.13
// version 2.0.14
var __bind = function(fn, me){
return function(){
......@@ -350,8 +350,8 @@ SwaggerResource.prototype.addModels = function(models) {
}
}
var output = [];
for (var i = 0; i < this.modelsArray; i++) {
model = this.modelsArray[_i];
for (var i = 0; i < this.modelsArray.length; i++) {
model = this.modelsArray[i];
output.push(model.setReferencedModels(this.models));
}
return output;
......@@ -450,7 +450,7 @@ var SwaggerModel = function(modelName, obj) {
SwaggerModel.prototype.setReferencedModels = function(allModels) {
var results = [];
for (i = 0; i < this.properties.length; i++) {
for (var i = 0; i < this.properties.length; i++) {
var property = this.properties[i];
var type = property.type || property.dataType;
if (allModels[type] != null)
......@@ -465,7 +465,7 @@ SwaggerModel.prototype.setReferencedModels = function(allModels) {
SwaggerModel.prototype.getMockSignature = function(modelsToIgnore) {
var propertiesStr = [];
for (i = 0; i < this.properties.length; i++) {
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
propertiesStr.push(prop.toString());
}
......@@ -480,7 +480,7 @@ SwaggerModel.prototype.getMockSignature = function(modelsToIgnore) {
modelsToIgnore = [];
modelsToIgnore.push(this);
for (i = 0; i < this.properties.length; i++) {
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
if ((prop.refModel != null) && modelsToIgnore.indexOf(prop.refModel) === -1) {
returnVal = returnVal + ('<br>' + prop.refModel.getMockSignature(modelsToIgnore));
......@@ -493,7 +493,7 @@ SwaggerModel.prototype.createJSONSample = function(modelsToIgnore) {
var result = {};
var modelsToIgnore = (modelsToIgnore||[])
modelsToIgnore.push(this.name);
for (i = 0; i < this.properties.length; i++) {
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
result[prop.name] = prop.getSampleValue(modelsToIgnore);
}
......@@ -534,7 +534,7 @@ var SwaggerModelProperty = function(name, obj) {
SwaggerModelProperty.prototype.getSampleValue = function(modelsToIgnore) {
var result;
if ((this.refModel != null) && (modelsToIgnore[this.refModel.name] === 'undefined')) {
if ((this.refModel != null) && (modelsToIgnore[this.refModel.name] === undefined)) {
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
if (this.isCollection) {
......@@ -615,8 +615,8 @@ var SwaggerOperation = function(nickname, path, method, parameters, summary, not
this.responseSampleJSON = this.getSampleJSON(this.type, this.resource.models);
}
for(i = 0; i < parameters.length; i ++) {
var param = parameters[i];
for(var i = 0; i < this.parameters.length; i ++) {
var param = this.parameters[i];
// might take this away
param.name = param.name || param.type || param.dataType;
......@@ -763,7 +763,7 @@ SwaggerOperation.prototype["do"] = function(args, opts, callback, error) {
}
var possibleParams = [];
for(i = 0; i < this.parameters.length; i++) {
for(var i = 0; i < this.parameters.length; i++) {
var param = this.parameters[i];
if(param.paramType === 'header') {
if(args[param.name])
......@@ -806,7 +806,7 @@ SwaggerOperation.prototype.pathXml = function() {
SwaggerOperation.prototype.urlify = function(args) {
var url = this.resource.basePath + this.pathJson();
var params = this.parameters;
for(i = 0; i < params.length; i ++){
for(var i = 0; i < params.length; i ++){
var param = params[i];
if (param.paramType === 'path') {
if(args[param.name]) {
......@@ -821,7 +821,7 @@ SwaggerOperation.prototype.urlify = function(args) {
}
var queryParams = "";
for(i = 0; i < params.length; i ++){
for(var i = 0; i < params.length; i ++){
var param = params[i];
if(param.paramType === 'query') {
if(queryParams !== '')
......@@ -853,7 +853,7 @@ SwaggerOperation.prototype.getHeaderParams = function(args) {
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args) {
var matchingParams = {};
var params = this.parameters;
for (i = 0; i < params.length; i++) {
for (var i = 0; i < params.length; i++) {
param = params[i];
if (args && args[param.name])
matchingParams[param.name] = args[param.name];
......@@ -869,7 +869,7 @@ SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args) {
SwaggerOperation.prototype.help = function() {
var msg = "";
var params = this.parameters;
for (i = 0; i < params.length; i++) {
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (msg !== "")
msg += "\n";
......@@ -908,7 +908,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
var params = this.operation.parameters;
for(i = 0; i < params.length; i++) {
for(var i = 0; i < params.length; i++) {
var param = params[i];
if(param.paramType === "form")
formParams.push(param);
......@@ -958,7 +958,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
var possibleParams = {};
var values = {};
for(i = 0; i < formParams.length; i++){
for(var i = 0; i < formParams.length; i++){
var param = formParams[i];
values[param.name] = param;
}
......@@ -1095,7 +1095,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
headers = {};
headerArray = response.getAllResponseHeaders().split(":");
for(i = 0; i < headerArray.length / 2; i++)
for(var i = 0; i < headerArray.length / 2; i++)
headers[headerArray[i] = headerArray[i+1]];
out = {
......@@ -1107,9 +1107,15 @@ JQueryHttpClient.prototype.execute = function(obj) {
headers: headers
};
if(response._headers["Content-Type"] && response._headers["Content-Type"].indexOf("application/json") == 0 &&
response.content.data && response.content.data !== "") {
out.obj = JSON.parse(response.responseText);
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if(response.responseText && response.responseText !== "")
out.obj = JSON.parse(response.responseText);
else
out.obj = {}
}
}
if(response.status >= 200 && response.status < 300)
......@@ -1186,7 +1192,7 @@ ShredHttpClient.prototype.execute = function(obj) {
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if(response.content.data && response.content.data !== "")
out.obj = JSON.parse(response.content.data);
else
......
{
"name": "swagger-ui",
"version": "2.0.7",
"version": "2.0.8",
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
"scripts": {
"build": "PATH=$PATH:./node_modules/.bin cake dist",
......@@ -19,7 +19,7 @@
"readmeFilename": "README.md",
"dependencies": {
"coffee-script": "~1.5.0",
"swagger-client": "2.0.13",
"swagger-client": "2.0.14",
"handlebars": "~1.0.10",
"less": "~1.4.2"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment