diff --git a/app/client/src/components/editorComponents/ApiResponseView.tsx b/app/client/src/components/editorComponents/ApiResponseView.tsx index 7d5345c979..364f840aa2 100644 --- a/app/client/src/components/editorComponents/ApiResponseView.tsx +++ b/app/client/src/components/editorComponents/ApiResponseView.tsx @@ -240,7 +240,7 @@ export const responseTabComponent = ( folding height={"100%"} input={{ - value: output ? JSON.stringify(output, null, 2) : "", + value: isString(output) ? output : JSON.stringify(output, null, 2), }} isReadOnly /> @@ -253,7 +253,7 @@ export const responseTabComponent = ( folding height={"100%"} input={{ - value: output ? JSON.stringify(output, null, 2) : "", + value: isString(output) ? output : JSON.stringify(output, null, 2), }} isRawView isReadOnly @@ -390,7 +390,7 @@ function ApiResponseView(props: Props) { ) : ( - {isString(response.body) && isHtml(response.body) && ( + {isString(response.body) && isHtml(response.body) ? ( - )} - {!isString(response.body) && - responseTabs && - responseTabs.length > 0 && - selectedTabIndex !== -1 ? ( + ) : responseTabs && + responseTabs.length > 0 && + selectedTabIndex !== -1 ? (