fix: unwanted double slashes when importing from openapi (#3745)
This commit is contained in:
@@ -549,13 +549,19 @@ const convertPathToHoppReqs = (
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Construct request object
|
// Construct request object
|
||||||
RA.map(({ method, info }) =>
|
RA.map(({ method, info }) => {
|
||||||
makeRESTRequest({
|
const openAPIUrl = parseOpenAPIUrl(doc)
|
||||||
|
const openAPIPath = replaceOpenApiPathTemplating(pathName)
|
||||||
|
|
||||||
|
const endpoint =
|
||||||
|
openAPIUrl.endsWith("/") && openAPIPath.startsWith("/")
|
||||||
|
? openAPIUrl + openAPIPath.slice(1)
|
||||||
|
: openAPIUrl + openAPIPath
|
||||||
|
|
||||||
|
return makeRESTRequest({
|
||||||
name: info.operationId ?? info.summary ?? "Untitled Request",
|
name: info.operationId ?? info.summary ?? "Untitled Request",
|
||||||
method: method.toUpperCase(),
|
method: method.toUpperCase(),
|
||||||
endpoint: `${parseOpenAPIUrl(doc)}${replaceOpenApiPathTemplating(
|
endpoint,
|
||||||
pathName
|
|
||||||
)}`,
|
|
||||||
|
|
||||||
// We don't need to worry about reference types as the Dereferencing pass should remove them
|
// We don't need to worry about reference types as the Dereferencing pass should remove them
|
||||||
params: parseOpenAPIParams(
|
params: parseOpenAPIParams(
|
||||||
@@ -572,7 +578,7 @@ const convertPathToHoppReqs = (
|
|||||||
preRequestScript: "",
|
preRequestScript: "",
|
||||||
testScript: "",
|
testScript: "",
|
||||||
})
|
})
|
||||||
),
|
}),
|
||||||
|
|
||||||
// Disable Readonly
|
// Disable Readonly
|
||||||
RA.toArray
|
RA.toArray
|
||||||
|
|||||||
Reference in New Issue
Block a user