updated swagger-js version to address #377, #72

This commit is contained in:
Tony Tam
2014-01-21 18:31:26 -08:00
parent ede80844a5
commit e7b9525911
4 changed files with 11 additions and 11 deletions

6
dist/lib/swagger.js vendored
View File

@@ -984,18 +984,18 @@
return _results;
}).call(this)).length > 0) {
type = param.type || param.dataType;
if ((function() {
if (((function() {
var _i, _len, _ref, _results;
_ref = this.operation.parameters;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
param = _ref[_i];
if ((typeof type !== 'undefined' && type.toLowerCase() === "file").length > 0) {
if (type.toLowerCase() === "file") {
_results.push(param);
}
}
return _results;
}).call(this)) {
}).call(this)).length > 0) {
requestContentType = "multipart/form-data";
} else {
requestContentType = "application/x-www-form-urlencoded";

12
dist/swagger-ui.js vendored
View File

@@ -1819,20 +1819,20 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
var code, content, contentType, headers, pre, response_body;
content = data.content.data;
headers = data.getHeaders();
contentType = headers["Content-Type"];
if (content === void 0) {
contentType = headers["Content-Type"] ? headers["Content-Type"].split(";")[0].trim() : null;
if (!content) {
code = $('<code />').text("no content");
pre = $('<pre class="json" />').append(code);
} else if (contentType.indexOf("application/json") === 0 || contentType.indexOf("application/hal+json") === 0) {
} else if (contentType === "application/json" || /\+json$/.test(contentType)) {
code = $('<code />').text(JSON.stringify(JSON.parse(content), null, 2));
pre = $('<pre class="json" />').append(code);
} else if (contentType.indexOf("application/xml") === 0) {
} else if (contentType === "application/xml" || /\+xml$/.test(contentType)) {
code = $('<code />').text(this.formatXml(content));
pre = $('<pre class="xml" />').append(code);
} else if (contentType.indexOf("text/html") === 0) {
} else if (contentType === "text/html") {
code = $('<code />').html(content);
pre = $('<pre class="xml" />').append(code);
} else if (contentType.indexOf("image/") === 0) {
} else if (/^image\//.test(contentType)) {
pre = $('<img>').attr('src', data.request.url);
} else {
code = $('<code />').text(content);

File diff suppressed because one or more lines are too long

View File

@@ -19,7 +19,7 @@
"readmeFilename": "README.md",
"dependencies": {
"coffee-script": "~1.5.0",
"swagger-client": "~2.0",
"swagger-client": "2.0.8",
"handlebars": "~1.0.10",
"less": "~1.4.2"
}