fix for #1253
This commit is contained in:
158
dist/swagger-ui.js
vendored
158
dist/swagger-ui.js
vendored
@@ -241,6 +241,28 @@ Handlebars.registerHelper('sanitize', function(html) {
|
|||||||
html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
||||||
return new Handlebars.SafeString(html);
|
return new Handlebars.SafeString(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('renderTextParam', function(param) {
|
||||||
|
var result;
|
||||||
|
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
|
||||||
|
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
||||||
|
|
||||||
|
if (typeof defaultValue === 'undefined') {
|
||||||
|
defaultValue = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isArray) {
|
||||||
|
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'';
|
||||||
|
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
|
||||||
|
result += defaultValue + '</textarea>';
|
||||||
|
} else {
|
||||||
|
result = '<input class=\'parameter\'' + (param.required ? ' class=\'required\'' : '') + ' minlength=\'' + (param.required ? 1 : 0) + '\'';
|
||||||
|
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'';
|
||||||
|
result += ' type=\'text\' value=\'' + defaultValue + '\'/>';
|
||||||
|
}
|
||||||
|
return new Handlebars.SafeString(result);
|
||||||
|
});
|
||||||
|
|
||||||
this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
|
this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
|
||||||
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">"
|
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">"
|
||||||
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
|
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
|
||||||
@@ -452,32 +474,36 @@ this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":functio
|
|||||||
},"5":function(depth0,helpers,partials,data) {
|
},"5":function(depth0,helpers,partials,data) {
|
||||||
return " multiple='multiple'";
|
return " multiple='multiple'";
|
||||||
},"7":function(depth0,helpers,partials,data) {
|
},"7":function(depth0,helpers,partials,data) {
|
||||||
|
return "'parameter required'";
|
||||||
|
},"9":function(depth0,helpers,partials,data) {
|
||||||
|
return "'parameter'";
|
||||||
|
},"11":function(depth0,helpers,partials,data) {
|
||||||
return "";
|
return "";
|
||||||
},"9":function(depth0,helpers,partials,data) {
|
},"13":function(depth0,helpers,partials,data) {
|
||||||
var stack1, buffer = "";
|
var stack1, buffer = "";
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(7, data),"inverse":this.program(10, data),"data":data});
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(14, data),"data":data});
|
||||||
if (stack1 != null) { buffer += stack1; }
|
|
||||||
return buffer;
|
|
||||||
},"10":function(depth0,helpers,partials,data) {
|
|
||||||
var stack1, helperMissing=helpers.helperMissing, buffer = "";
|
|
||||||
stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(7, data),"inverse":this.program(11, data),"data":data}));
|
|
||||||
if (stack1 != null) { buffer += stack1; }
|
|
||||||
return buffer;
|
|
||||||
},"11":function(depth0,helpers,partials,data) {
|
|
||||||
return " <option selected=\"\" value=''></option>\n";
|
|
||||||
},"13":function(depth0,helpers,partials,data) {
|
|
||||||
var stack1, buffer = "";
|
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.program(16, data),"data":data});
|
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
return buffer;
|
return buffer;
|
||||||
},"14":function(depth0,helpers,partials,data) {
|
},"14":function(depth0,helpers,partials,data) {
|
||||||
|
var stack1, helperMissing=helpers.helperMissing, buffer = "";
|
||||||
|
stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(11, data),"inverse":this.program(15, data),"data":data}));
|
||||||
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
return buffer;
|
||||||
|
},"15":function(depth0,helpers,partials,data) {
|
||||||
|
return " <option selected=\"\" value=''></option>\n";
|
||||||
|
},"17":function(depth0,helpers,partials,data) {
|
||||||
|
var stack1, buffer = "";
|
||||||
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(18, data),"inverse":this.program(20, data),"data":data});
|
||||||
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
return buffer;
|
||||||
|
},"18":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
||||||
return " <option selected=\"\" value='"
|
return " <option selected=\"\" value='"
|
||||||
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
||||||
+ "'>"
|
+ "'>"
|
||||||
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
||||||
+ " (default)</option>\n";
|
+ " (default)</option>\n";
|
||||||
},"16":function(depth0,helpers,partials,data) {
|
},"20":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
||||||
return " <option value='"
|
return " <option value='"
|
||||||
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
|
||||||
@@ -491,12 +517,15 @@ this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":functio
|
|||||||
buffer += "<td>\n <select ";
|
buffer += "<td>\n <select ";
|
||||||
stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data}));
|
stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data}));
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
buffer += " class='parameter' name='"
|
buffer += " class=";
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
|
||||||
+ "'>\n";
|
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(7, data),"inverse":this.program(9, data),"data":data});
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(7, data),"inverse":this.program(9, data),"data":data});
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data});
|
buffer += " name='"
|
||||||
|
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
||||||
|
+ "'>\n";
|
||||||
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data});
|
||||||
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data});
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
buffer += " </select>\n</td>\n<td class=\"markdown\">";
|
buffer += " </select>\n</td>\n<td class=\"markdown\">";
|
||||||
stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
|
stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
|
||||||
@@ -610,22 +639,12 @@ this["Handlebars"]["templates"]["param_required"] = Handlebars.template({"1":fun
|
|||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
||||||
+ "'/>\n";
|
+ "'/>\n";
|
||||||
},"12":function(depth0,helpers,partials,data) {
|
},"12":function(depth0,helpers,partials,data) {
|
||||||
var stack1, buffer = "";
|
var stack1, helperMissing=helpers.helperMissing, buffer = "";
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.program(15, data),"data":data});
|
stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data}));
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
return buffer;
|
return buffer;
|
||||||
},"13":function(depth0,helpers,partials,data) {
|
},"13":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
return "";
|
||||||
return " <input class='parameter required' minlength='1' name='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
|
||||||
+ "' placeholder='(required)' type='text' value='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
|
|
||||||
+ "'/>\n";
|
|
||||||
},"15":function(depth0,helpers,partials,data) {
|
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
|
||||||
return " <input class='parameter required' minlength='1' name='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
|
||||||
+ "' placeholder='(required)' type='text' value=''/>\n";
|
|
||||||
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
||||||
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'>"
|
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'>"
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
||||||
@@ -673,22 +692,12 @@ this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(dep
|
|||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
return buffer;
|
return buffer;
|
||||||
},"10":function(depth0,helpers,partials,data) {
|
},"10":function(depth0,helpers,partials,data) {
|
||||||
var stack1, buffer = "";
|
var stack1, helperMissing=helpers.helperMissing, buffer = "";
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data});
|
stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data}));
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
return buffer;
|
return buffer;
|
||||||
},"11":function(depth0,helpers,partials,data) {
|
},"11":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
return "";
|
||||||
return " <input class='parameter' minlength='0' name='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
|
||||||
+ "' placeholder='' type='text' value='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
|
|
||||||
+ "'/>\n";
|
|
||||||
},"13":function(depth0,helpers,partials,data) {
|
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
|
||||||
return " <input class='parameter' minlength='0' name='"
|
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
|
||||||
+ "' placeholder='' type='text' value=''/>\n";
|
|
||||||
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
||||||
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'>"
|
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'>"
|
||||||
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
|
||||||
@@ -21216,11 +21225,30 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
error_free = false;
|
error_free = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
form.find('select.required').each(function() {
|
||||||
|
$(this).removeClass('error');
|
||||||
|
if (this.selectedIndex === -1) {
|
||||||
|
$(this).addClass('error');
|
||||||
|
$(this).wiggle({
|
||||||
|
callback: (function(_this) {
|
||||||
|
return function() {
|
||||||
|
$(_this).focus();
|
||||||
|
};
|
||||||
|
})(this)
|
||||||
|
});
|
||||||
|
error_free = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
if (error_free) {
|
if (error_free) {
|
||||||
map = {};
|
map = {};
|
||||||
opts = {
|
opts = {
|
||||||
parent: this
|
parent: this
|
||||||
};
|
};
|
||||||
|
if(this.options.swaggerOptions) {
|
||||||
|
for(var key in this.options.swaggerOptions) {
|
||||||
|
opts[key] = this.options.swaggerOptions[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
isFileUpload = false;
|
isFileUpload = false;
|
||||||
ref1 = form.find('input');
|
ref1 = form.find('input');
|
||||||
for (l = 0, len = ref1.length; l < len; l++) {
|
for (l = 0, len = ref1.length; l < len; l++) {
|
||||||
@@ -21236,8 +21264,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
ref2 = form.find('textarea');
|
ref2 = form.find('textarea');
|
||||||
for (m = 0, len1 = ref2.length; m < len1; m++) {
|
for (m = 0, len1 = ref2.length; m < len1; m++) {
|
||||||
o = ref2[m];
|
o = ref2[m];
|
||||||
if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
|
val = this.getTextAreaValue(o);
|
||||||
map[o.name] = o.value;
|
if ((val !== null) && jQuery.trim(val).length > 0) {
|
||||||
|
map[o.name] = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ref3 = form.find('select');
|
ref3 = form.find('select');
|
||||||
@@ -21254,7 +21283,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
if (isFileUpload) {
|
if (isFileUpload) {
|
||||||
return this.handleFileUpload(map, form);
|
return this.handleFileUpload(map, form);
|
||||||
} else {
|
} else {
|
||||||
return this.model.execute(map, this.options.swaggerOptions || {}, this.showCompleteStatus, this.showErrorStatus, this);
|
return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -21607,7 +21636,40 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
} else {
|
} else {
|
||||||
Docs.expandOperation(elem);
|
Docs.expandOperation(elem);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getTextAreaValue: function(textArea) {
|
||||||
|
var param, parsed, result, i;
|
||||||
|
if (textArea.value === null || jQuery.trim(textArea.value).length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
param = this.getParamByName(textArea.name);
|
||||||
|
if (param && param.type && param.type.toLowerCase() === 'array') {
|
||||||
|
parsed = textArea.value.split('\n');
|
||||||
|
result = [];
|
||||||
|
for (i = 0; i < parsed.length; i++) {
|
||||||
|
if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) {
|
||||||
|
result.push(parsed[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.length > 0 ? result : null;
|
||||||
|
} else {
|
||||||
|
return textArea.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getParamByName: function(name) {
|
||||||
|
var i;
|
||||||
|
if (this.model.parameters) {
|
||||||
|
for(i = 0; i < this.model.parameters.length; i++) {
|
||||||
|
if (this.model.parameters[i].name === name) {
|
||||||
|
return this.model.parameters[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|||||||
17
dist/swagger-ui.min.js
vendored
17
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -294,6 +294,11 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
opts = {
|
opts = {
|
||||||
parent: this
|
parent: this
|
||||||
};
|
};
|
||||||
|
if(this.options.swaggerOptions) {
|
||||||
|
for(var key in this.options.swaggerOptions) {
|
||||||
|
opts[key] = this.options.swaggerOptions[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
isFileUpload = false;
|
isFileUpload = false;
|
||||||
ref1 = form.find('input');
|
ref1 = form.find('input');
|
||||||
for (l = 0, len = ref1.length; l < len; l++) {
|
for (l = 0, len = ref1.length; l < len; l++) {
|
||||||
@@ -328,7 +333,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
if (isFileUpload) {
|
if (isFileUpload) {
|
||||||
return this.handleFileUpload(map, form);
|
return this.handleFileUpload(map, form);
|
||||||
} else {
|
} else {
|
||||||
return this.model.execute(map, this.options.swaggerOptions || {}, this.showCompleteStatus, this.showErrorStatus, this);
|
return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user