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

Can't import a POSTMAN collection with a / char in the name #219

Open
l0new4nder3r opened this issue Sep 27, 2023 · 10 comments
Open

Can't import a POSTMAN collection with a / char in the name #219

l0new4nder3r opened this issue Sep 27, 2023 · 10 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@l0new4nder3r
Copy link

When attempting to import a postman collection with a name containing "/", the initial detection seems correct ("name" is correctly displayed), the import seems to be successful...
"Collection imported successfully" is being displayed, but the collection is not imported at all (nothing in the destination folder, and no new collection opened in the main interface).

When looking at the dev console (postman collection called "MYAPP\SOMETHING ELSE", by example)

Uncaught (in promise) Error: Error invoking remote method 'renderer:import-collection': Error: ENOENT: no such file or directory, mkdir 'C:\Users\MY_USER\Documents\Bruno collections\MYAPP\SOMETHING ELSE'

Removing or replacing the "/" char leads to a successful import

@helloanoop helloanoop added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Sep 27, 2023
@helloanoop
Copy link
Contributor

@l0new4nder3r The fix done by @tpyle has been released in v0.16.3

Can you test and confirm this on your end ?

@l0new4nder3r
Copy link
Author

Hi, thanks @tpyle !

Successfully tested a few minutes ago with v0.16.4

Capture d’écran 2023-09-30 à 21 43 38

Testing with a postman collection containing a slash in its name property.

Capture d’écran 2023-09-30 à 21 42 10

Importing process (same as before, slash is still present)

Capture d’écran 2023-09-30 à 21 42 40

The collection is imported without issue - the only thing is that now, its name has changed.
The slash has become an hyphen.
Consistent with what I see in the commit, and at least it does not break!

Improvement with a much lesser priority : allow any character in the collection name?

@tpyle
Copy link
Contributor

tpyle commented Sep 30, 2023

Hi @l0new4nder3r,

Unfortunately, since bruno stores collections (and requests) as files and directories, that requirement comes from the filesystem, not from bruno itself. Every filesystem that I'm aware of doesn't allow / in directory names or folder names, as it's used in UNIX-like OS's as a delimiter between directories.

I suppose we could URL encode the collection name (so that in the filesystem it looks like Collection%2FName, and then render it to the user as Collection/Name), but I feel like that's somewhat odd of behavior. What are your thoughts on this @helloanoop?

@helloanoop
Copy link
Contributor

Yes, Its a restriction at the filesystem level.

You can still choose to rename the collection in the UI and that will reflect in the UI. Meaning you can change it to Ex: "Payment/ConfigApi". This name gets updated in bruno.json which the UI will consume to render the name.

But in the filesystem level we are bounded by the naming restrictions of filesystem

bruno.json

{
  "version": "1",
  "name": "Payment/ConfigApi",
  "type": "collection"
  }
}

@irfansofyana
Copy link

Hey, I'm encountering similar issue here, but with different chars. I'm trying to import a postman collection with name [POC] XXX and when it's imported, I see a blank result in the IDE

@tpyle
Copy link
Contributor

tpyle commented Oct 4, 2023

@irfansofyana can you tell me what OS you're on? Or what filesystem you're using, if you're aware? If you're on a linux/unix/mac system, you should be able to run df -T to tell.

@holycacao
Copy link

New user here. I name most of my requests after their route eg bruno/issues. Renaming collections works, but not requests. This is quite restrictive.

..but it looks like this is may just be a UI bug? If I manually change the name in the meta section of the request bru file, it is reflected in the UI. However, if I change it in the UI, it silently does nothing.

@DaPutzy
Copy link
Contributor

DaPutzy commented Oct 6, 2023

Can confirm, there is something fishy with renaming requests via ui 🤔

@irfansofyana
Copy link

@irfansofyana can you tell me what OS you're on? Or what filesystem you're using, if you're aware? If you're on a linux/unix/mac system, you should be able to run df -T to tell.

Hi, I'm using macOS

@ItsJustRuby
Copy link

Can confirm, there is something fishy with renaming requests via ui 🤔

See also various other issues like #1336 and #1404, which are currently being solved in #349.

I am in favor of tracking the solution to the original problem (importing from Postman) in this issue.

Its-treason added a commit to Its-treason/bruno that referenced this issue Mar 14, 2024
The collection name was changed to the sanitized directory, but the
collection name is saved in the bruno.json where it does not need
to be sanitized

Fixes:
- usebruno#1651
- usebruno#219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants