feat: new ui for response interface generation (#4105)

* feat: codegen body added

* feat: new ui added for response interface

* feat: generate code component added

* chore: default collection tab

* feat: generate data schema

* chore: clean up

* chore: minor code refactor

* fix: only render if `isDrawerOpen` is true

* chore: clean up

* chore: clean up

---------

Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
Anwarul Islam
2024-08-30 12:40:52 +06:00
committed by GitHub
parent a177bdced0
commit 9ad6a419c1
8 changed files with 467 additions and 251 deletions

View File

@@ -172,13 +172,17 @@ export function useResponseBody(response: HoppRESTResponse): {
response.type === "extension_error"
)
return ""
if (typeof response.body === "string") return response.body
const res = new TextDecoder("utf-8").decode(response.body)
// HACK: Temporary trailing null character issue from the extension fix
return res.replace(/\0+$/, "")
return getResponseBodyText(response.body)
})
return {
responseBodyText,
}
}
export function getResponseBodyText(body: ArrayBuffer): string {
if (typeof body === "string") return body
const res = new TextDecoder("utf-8").decode(body)
// HACK: Temporary trailing null character issue from the extension fix
return res.replace(/\0+$/, "")
}