Support string-based url.path in Postman importer. (#490)

This commit is contained in:
Joris van Eijden
2026-07-01 20:47:53 +02:00
committed by GitHub
parent a6558329e2
commit 5a74a989b5
2 changed files with 36 additions and 2 deletions
@@ -57,4 +57,34 @@ describe("importer-postman", () => {
}),
]);
});
test("Imports url.path when it is a string instead of an array", () => {
const result = convertPostman(
JSON.stringify({
info: {
name: "String Path Test",
schema: "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
},
item: [
{
name: "String Path",
request: {
method: "GET",
url: {
host: ["example", "com"],
path: "foo/bar",
},
},
},
],
}),
);
expect(result?.resources.httpRequests).toEqual([
expect.objectContaining({
name: "String Path",
url: "example.com/foo/bar",
}),
]);
});
});