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

fix: handling invalid import environment names (#2197) #2200

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

igor-topolski
Copy link

Description

Resolves: #2197

This PR effectively addresses the issue I raised (#2197). To ensure no clashes and unexpected behaviours, I've implemented a solution that displays a descriptive error instead of automatically resolving issues (unlike in the case of collections). This prevents multiple environments from having the same name, e.g. My / Environment / Name and My : Environment : Name would be translated into the same My - Environment - Name if the same strategy (as for collections) was used.

If the Postman collection contains any of the following: <, >, :, ", /, \, |, ?, *, the import will fail with the following message: The environment name contains one or more illegal characters (<, >, :, ", /, \, |, ?, *).

Problematic payload:
image

Old behaviour
image

New behaviour
image

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@busy-panda
Copy link

busy-panda commented May 1, 2024

There are already two PR regarding this problem:

#1761

@igor-topolski
Copy link
Author

There are already two PR regarding this problem:

#1761 #1651

Thanks for pointing it out, it looks like other solutions are erroneous though as they will not work correctly for e.g. Some / Invalid / Name. Also, they risk name clash, e.g. Some / Env and Some [ Env with results in the same name.

@busy-panda
Copy link

If you don't mind I made a PR that is more consistent with the collection import, and don't bother the user to go back to the postman environment and change the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forward slash in environment name causes Postman import failure
2 participants