Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of freshly exported Bruno Collection fails #2182

Open
2 tasks done
angelaatskandia opened this issue Apr 26, 2024 · 2 comments · May be fixed by #2220
Open
2 tasks done

Import of freshly exported Bruno Collection fails #2182

angelaatskandia opened this issue Apr 26, 2024 · 2 comments · May be fixed by #2220
Labels
bug Something isn't working

Comments

@angelaatskandia
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • 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)

  1. Chose to Export the Collection
  2. Closed the Collection
  3. Chose to import Bruno Collection using the "three dots"
  4. Selected the json file cerated under step 1
  5. Received error tooltip saying "import collection failed"

.bru file to reproduce the bug

No response

Screenshots/Live demo link

1Export

2SelectingBrunoExport

3ImportUsingThreeDots

4SelectingBrunoCollection

5ErrorTooltip

@angelaatskandia angelaatskandia added the bug Something isn't working label Apr 26, 2024
@DmytroCrawford
Copy link

Is this failure not caused because the collection exported and the collection being imported have the same name?

@krummbar
Copy link
Contributor

krummbar commented Apr 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants