馃憖 Is there an existing issue for this?
馃憤 Current behavior
When I import a Postman collection that contains a folder, keploy import postman incorrectly treats the folder itself as an API request.
For testing, I created a minimal collection.json with this Postman structure:
Users <-- Postman folder
List users <-- actual API request
The actual request has a URL, but the folder Users does not. When I run the import command and answer yes to the capture prompt, Keploy tries to process Users as a request and fails with:
ERROR URL is empty {"testItem": "Users"}
ERROR failed to import Postman collection {"error": "URL is empty"}
Expected behavior:
Keploy should treat Users as a folder only, and should import only the nested request List users.
馃憻 Steps to Replicate
- Create a temporary repro folder:
mkdir -p /private/tmp/keploy-postman-var-repro
cd /private/tmp/keploy-postman-var-repro
- Create
collection.json with a Postman folder named Users and one request inside it:
{
"info": {
"_postman_id": "11111111-1111-1111-1111-111111111111",
"name": "Folder repro",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "Users",
"item": [
{
"name": "List users",
"request": {
"method": "GET",
"header": [],
"url": "https://api.example.test/users"
},
"response": []
}
]
}
]
}
- Build Keploy from local source into a temporary binary path:
cd (to your local repo path)
mkdir -p /private/tmp/keploy-bin
go build -o /private/tmp/keploy-bin/keploy .
- Run the Postman import from the repro folder:
cd /private/tmp/keploy-postman-var-repro
printf 'yes\n' | /private/tmp/keploy-bin/keploy import postman --path collection.json --disable-ansi
- See the error:
ERROR URL is empty {"testItem": "Users"}
ERROR failed to import Postman collection {"error": "URL is empty"}
My temporary folder structure during testing was:
/private/tmp/
keploy-bin/
keploy
keploy-postman-var-repro/
collection.json
馃摐 Logs (if any)
Some responses are empty. We need to hit the server to record these responses. Is your server running? (yes/no):
ERROR URL is empty {"testItem": "Users"}
ERROR failed to import Postman collection {"error": "URL is empty"}
馃捇 Operating system
macOS
馃Ь System Info (uname -a)
Darwin Utkarshs-MacBook-Air.local 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103 arm64
馃摝 OS Release Info (cat /etc/os-release)
Not applicable, running on macOS.
馃惓 Docker Info (if applicable)
Not using Docker for this reproduction.
馃П Your Environment
Local machine reproduction.
Repo path:
(to your local repo path)
Temporary binary path:
/private/tmp/keploy-bin/keploy
Temporary repro path:
/private/tmp/keploy-postman-var-repro
馃幉 Version
Built from local main branch. Keploy output shows version: 3-dev.
馃摝 Repository
馃 What use case were you trying? (optional)
I was trying to import a Postman collection into Keploy tests. The collection has folders, which is common in Postman for grouping API requests.
馃憖 Is there an existing issue for this?
馃憤 Current behavior
When I import a Postman collection that contains a folder,
keploy import postmanincorrectly treats the folder itself as an API request.For testing, I created a minimal
collection.jsonwith this Postman structure:The actual request has a URL, but the folder
Usersdoes not. When I run the import command and answeryesto the capture prompt, Keploy tries to processUsersas a request and fails with:Expected behavior:
Keploy should treat
Usersas a folder only, and should import only the nested requestList users.馃憻 Steps to Replicate
mkdir -p /private/tmp/keploy-postman-var-repro cd /private/tmp/keploy-postman-var-reprocollection.jsonwith a Postman folder namedUsersand one request inside it:{ "info": { "_postman_id": "11111111-1111-1111-1111-111111111111", "name": "Folder repro", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ { "name": "Users", "item": [ { "name": "List users", "request": { "method": "GET", "header": [], "url": "https://api.example.test/users" }, "response": [] } ] } ] }My temporary folder structure during testing was:
馃摐 Logs (if any)
馃捇 Operating system
macOS
馃Ь System Info (
uname -a)馃摝 OS Release Info (
cat /etc/os-release)馃惓 Docker Info (if applicable)
馃П Your Environment
Local machine reproduction.
Repo path:
Temporary binary path:
Temporary repro path:
馃幉 Version
馃摝 Repository
馃 What use case were you trying? (optional)
I was trying to import a Postman collection into Keploy tests. The collection has folders, which is common in Postman for grouping API requests.