Import of freshly exported Bruno Collection fails
I have checked the following:
- [X] I use the newest version of bruno.
- [X] I've searched existing issues and found nothing related to my issue.
Describe the bug
When importing a Bruno collection that was created using Export (GUI) the collection is not imported and tooltip saying "import collection failed".
The problem has been seen for other collections as well and on different versions v1.12.1, v1.13.0, v1.14.0
How to reproduce (see screenshots)
- Chose to Export the Collection
- Closed the Collection
- Chose to import Bruno Collection using the "three dots"
- Selected the json file cerated under step 1
- Received error tooltip saying "import collection failed"
.bru file to reproduce the bug
No response
Screenshots/Live demo link
Is this failure not caused because the collection exported and the collection being imported have the same name?
Is this failure not caused because the collection exported and the collection being imported have the same name?
No this looks like a parsing issue. I tried it with bruno-testbench collection. When exporting/importing, this error is dumped in the console
ValidationError: items[5].type must be one of the following values: http-request, graphql-request, folder
at Object.createError (_app-9570891bf88d2432.js:36:69067)
at Object.test (_app-9570891bf88d2432.js:39:3708)
at validate (_app-9570891bf88d2432.js:36:69324)
at runTests (_app-9570891bf88d2432.js:36:66715)
at _app-9570891bf88d2432.js:39:758
at _app-9570891bf88d2432.js:36:66448
at _app-9570891bf88d2432.js:36:66968
at _app-9570891bf88d2432.js:36:69388
897-fea41f0406a7d7c9.js:1 BrunoError: The Collection file is corrupted
at 897-fea41f0406a7d7c9.js:1:5447
Looking at the JSON file, the sixth element look like this
{
"type": "json",
"name": "bruno",
"seq": 1
}
After removing it, the collection imports just fine, also with the same name. Looks like the importer doesn't like the type attribute json, as it expects http-request, graphql-request, folder.
I'd gladly try to fix this, but I'm not sure how to deal with this element. I'm wondering about the intention of that item:
- Should it be excluded during the export?
- Should it be ignored while importing?
- Should it be considered on import, and what does it do?
This is the unmodified exported collection: bruno-testbench-source.json
Closing this as the issue has already been fixed. Thank you all for taking the time to report the bug!