Skip to content

Commit 1b12909

Browse files
committed
Format response json in pretty format on success response.
1 parent c7d78bb commit 1b12909

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ doc/
22
node_modules/
33
tmp/
44
npm-debug.log
5+
.idea

template/css/style.css

+4-10
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,11 @@ pre code {
235235
white-space: pre;
236236
}
237237

238-
/*
239-
pre.language-json {
240-
background: #f5f5f5;
241-
border: #e0e0e0 1px solid;
242-
}
243-
244-
pre.language-json .pln,
245-
pre.language-json .pun {
246-
color: #3a3a3a;
238+
pre code.sample-request-response-json {
239+
white-space: pre-wrap;
240+
max-height: 500px;
241+
overflow: auto;
247242
}
248-
*/
249243

250244
/* ------------------------------------------------------------------------------------------
251245
* Sidenav

template/utils/send_sample_request.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ define([
110110
return queryParms;
111111
}
112112

113-
function displaySuccess(data) {
113+
function displaySuccess(data, status, jqXHR) {
114114
var jsonResponse;
115115
try {
116-
jsonResponse = JSON.stringify(data, null, 4);
116+
jsonResponse = JSON.parse(jqXHR.responseText);
117+
jsonResponse = JSON.stringify(jsonResponse, null, 4);
117118
} catch (e) {
118119
jsonResponse = data;
119120
}

0 commit comments

Comments
 (0)