File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/hoppscotch-common/src/helpers/import-export/import Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -754,6 +754,8 @@ const parseOpenAPIUrl = (
754754 **/
755755
756756 if ( objectHasProperty ( doc , "swagger" ) ) {
757+ // TODO: dynamically add doc.host, doc.basePath value as variables in the environment if available. or notify user to add it.
758+ // add base url variable to each request
757759 const host = doc . host ?. trim ( ) || "<<baseUrl>>"
758760 const basePath = doc . basePath ?. trim ( ) || ""
759761 return `${ host } ${ basePath } `
@@ -765,7 +767,9 @@ const parseOpenAPIUrl = (
765767 * Relevant v3 reference: https://swagger.io/specification/#server-object
766768 **/
767769 if ( objectHasProperty ( doc , "servers" ) ) {
768- return doc . servers ?. [ 0 ] ?. url ?? "<<baseUrl>>"
770+ // TODO: dynamically add server URL value as variable in the environment if available, or notify user to add it.
771+ const serverUrl = doc . servers ?. [ 0 ] ?. url
772+ return ! serverUrl || serverUrl === "./" ? "<<baseUrl>>" : serverUrl
769773 }
770774
771775 // If the document is neither v2 nor v3 or missing required fields
You can’t perform that action at this time.
0 commit comments