From 868eab0344656cf2ebc4792f90bfc8a34a6bf173 Mon Sep 17 00:00:00 2001 From: alyson t Date: Sun, 26 Apr 2020 13:27:51 +0900 Subject: [PATCH] Modify responseType by Object(json) or Array(json5) Editor component can't recognize json Array. (It accepts json Object.) If json Array, set this.responseBodyType 'json5'. --- pages/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.vue b/pages/index.vue index 224ffcb11..f68d7a966 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1474,7 +1474,7 @@ export default { this.responseType === "application/vnd.api+json" ) { this.responseBodyText = JSON.stringify(this.response.body, null, 2) - this.responseBodyType = "json" + this.responseBodyType = this.response.body.constructor.name === "Object" ? "json" : "json5" } else if (this.responseType === "text/html") { this.responseBodyText = this.response.body this.responseBodyType = "html"