Browse Source

form data fix

bubble
Tony Tam 11 years ago
parent
commit
11b4d6d077
4 changed files with 36 additions and 19 deletions
  1. +1
    -14
      dist/lib/swagger.js
  2. +33
    -3
      dist/swagger-ui.js
  3. +1
    -1
      dist/swagger-ui.min.js
  4. +1
    -1
      src/main/coffeescript/view/OperationView.coffee

+ 1
- 14
dist/lib/swagger.js View File

@@ -403,20 +403,7 @@
if (this.isCollection) {
result = this.refDataType;
} else {
if(this.dataType === 'int'){
result = 0;

}else if(this.dataType === 'long' || this.dataType === 'float'){
result = parseFloat("0.1");
}
else if(this.dataType === 'boolean')
{
result = false;
}
else
{
result = this.dataType;
}
result = this.dataType;
}
}
if (this.isCollection) {


+ 33
- 3
dist/swagger-ui.js View File

@@ -300,7 +300,7 @@ function program3(depth0,data) {
function program5(depth0,data) {
return "\n <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" >Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 320px; max-width: 330px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n ";}
return "\n <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\">Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 100px; max-width: 100px\">Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n ";}

function program7(depth0,data) {
@@ -629,6 +629,12 @@ function program12(depth0,data) {
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td>";
foundHelper = helpers.paramType;
stack1 = foundHelper || depth0.paramType;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "paramType", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n\n";
return buffer;});
})();
@@ -753,6 +759,12 @@ function program11(depth0,data) {
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td>";
foundHelper = helpers.paramType;
stack1 = foundHelper || depth0.paramType;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "paramType", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
return buffer;});
})();
@@ -831,6 +843,12 @@ function program6(depth0,data) {
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td>";
foundHelper = helpers.paramType;
stack1 = foundHelper || depth0.paramType;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "paramType", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
return buffer;});
})();
@@ -909,6 +927,12 @@ function program6(depth0,data) {
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td>";
foundHelper = helpers.paramType;
stack1 = foundHelper || depth0.paramType;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "paramType", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
return buffer;});
})();
@@ -1076,7 +1100,13 @@ function program15(depth0,data) {
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</strong>\n</td>\n<td><span class=\"model-signature\"></span></td>\n";
buffer += "</strong>\n</td>\n<td>";
foundHelper = helpers.paramType;
stack1 = foundHelper || depth0.paramType;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "paramType", { hash: {} }); }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
return buffer;});
})();

@@ -1646,7 +1676,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
obj.contentType = paramContentTypeField;
}
log('content type = ' + obj.contentType);
if (!obj.data || (obj.type === 'GET' || obj.type === 'DELETE')) {
if (!(obj.data || (obj.type === 'GET' || obj.type === 'DELETE')) && obj.contentType === !"application/x-www-form-urlencoded") {
obj.contentType = false;
}
log('content type is now = ' + obj.contentType);


+ 1
- 1
dist/swagger-ui.min.js
File diff suppressed because it is too large
View File


+ 1
- 1
src/main/coffeescript/view/OperationView.coffee View File

@@ -156,7 +156,7 @@ class OperationView extends Backbone.View

log 'content type = ' + obj.contentType

if not obj.data or (obj.type is 'GET' or obj.type is 'DELETE')
if not (obj.data or (obj.type is 'GET' or obj.type is 'DELETE')) and obj.contentType is not "application/x-www-form-urlencoded"
obj.contentType = false

log 'content type is now = ' + obj.contentType


Loading…
Cancel
Save