undid double stringify

This commit is contained in:
Tony Tam
2014-09-28 20:23:04 -07:00
parent b0eff2d78b
commit a39ab425bf
3 changed files with 3 additions and 3 deletions

2
dist/swagger-ui.js vendored
View File

@@ -2096,7 +2096,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
} else if (contentType === "application/json" || /\+json$/.test(contentType)) { } else if (contentType === "application/json" || /\+json$/.test(contentType)) {
json = null; json = null;
try { try {
json = JSON.stringify(JSON.stringify(JSON.parse(content), null, " ")); json = JSON.stringify(JSON.parse(content), null, " ");
} catch (_error) { } catch (_error) {
e = _error; e = _error;
json = "can't parse JSON. Raw result:\n\n" + content; json = "can't parse JSON. Raw result:\n\n" + content;

File diff suppressed because one or more lines are too long

View File

@@ -368,7 +368,7 @@ class OperationView extends Backbone.View
else if contentType is "application/json" || /\+json$/.test(contentType) else if contentType is "application/json" || /\+json$/.test(contentType)
json = null json = null
try try
json = JSON.stringify(JSON.stringify(JSON.parse(content), null, " ")) json = JSON.stringify(JSON.parse(content), null, " ")
catch e catch e
json = "can't parse JSON. Raw result:\n\n" + content json = "can't parse JSON. Raw result:\n\n" + content
code = $('<code />').text(json) code = $('<code />').text(json)