Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix(import/postman): handle non-string form values (#4645)

med8bra37b7ddf2b096
diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts b/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts
index e43697e8b..b3ddc0191 100644
--- a/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts
+++ b/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts
@@ -296,7 +296,7 @@ const getHoppReqBody = ({
<FormDataKeyValue>{
key: replacePMVarTemplating(param.key),
value: replacePMVarTemplating(
- param.type === "text" ? (param.value as string) : ""
+ param.type === "text" ? String(param.value) : ""
),
active: !param.disabled,
isFile: false, // TODO: Preserve isFile state ?
@@ -313,7 +313,7 @@ const getHoppReqBody = ({
(param) =>
`${replacePMVarTemplating(
param.key ?? ""
- )}: ${replacePMVarTemplating(param.value ?? "")}`
+ )}: ${replacePMVarTemplating(String(param.value ?? ""))}`
),
stringArrayJoin("\n")
),