Skip to content

Commit 53bef15

Browse files
committed
using v6.0.0 of scanned apis fix
1 parent c870628 commit 53bef15

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/Preview.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ const parseDoubleEncodedJson = (obj: any): any => {
228228
}
229229
230230
const highlightCode = (json) => {
231+
if (!json) {
232+
successResponseBody.value = ''
233+
return
234+
}
235+
231236
if (json.error) {
232237
// Parse double-encoded JSON error messages to display them cleanly
233238
const errorObj = parseDoubleEncodedJson(json.error)
@@ -236,14 +241,12 @@ const highlightCode = (json) => {
236241
successResponseBody.value = hljs.lineNumbersValue(
237242
hljs.highlightAuto(JSON.stringify(errorObj, null, 4), ['JSON']).value
238243
)
239-
} else if (json) {
244+
} else {
240245
// Parse double-encoded JSON in successful responses too
241246
const parsedJson = parseDoubleEncodedJson(json)
242247
successResponseBody.value = hljs.lineNumbersValue(
243248
hljs.highlightAuto(JSON.stringify(parsedJson, null, 4), ['JSON']).value
244249
)
245-
} else {
246-
successResponseBody.value = ''
247250
}
248251
}
249252
const submitEntitlement = async () => {

0 commit comments

Comments
 (0)