Skip to content

Save imported Postman collections when other collections exist - #219

Open
jayhemnani9910 wants to merge 1 commit into
Julien-cpsn:mainfrom
jayhemnani9910:fix/save-imported-postman-collections
Open

jayhemnani9910 wants to merge 1 commit into
Julien-cpsn:mainfrom
jayhemnani9910:fix/save-imported-postman-collections

Conversation

@jayhemnani9910

Copy link
Copy Markdown

Importing a Postman collection when the directory already has collections prints the found requests but saves nothing, so the imported collection is gone the next time ATAC starts.

atac -d dir collection new Existing
atac -d dir import postman shop.json   # "Collection name: Shop API ... Found request ..."
ls dir                                  # Existing.json only

After appending the imported collections to self.collections, the loop saved indices 0..collections_length, which are the collections that were already there. It now saves from the first new index to the end.

Added tests/cli_import_postman.rs, which creates a collection, imports a Postman file and checks the new file exists; it fails without the change. cargo test passes.

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.

1 participant