Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix(common): handle missing host and basePath in OpenAPI URL parsing (#4908)
Anwarul Islam5f3a7754d598
diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts b/packages/hoppscotch-common/src/helpers/import-export/import/openapi.tsindex 2678389dc..1d4516ed2 100644--- a/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts+++ b/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts@@ -745,7 +745,9 @@ const parseOpenAPIUrl = (**/if (objectHasProperty(doc, "swagger")) {- return `${doc.host}${doc.basePath}`+ const { host = "<<baseUrl>>", basePath = "" } =+ doc satisfies OpenAPIV2.Document+ return `${host}${basePath}`}/**