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

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

parent ede80844
......@@ -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";
......
......@@ -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);
......
This diff is collapsed.
......@@ -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"
}
......
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