Skip to content

impostman-import-file forces a valid env json file #7

@bingoUV

Description

@bingoUV

Bug summary

As per the documentation, for impostman-import-file the env file is optional. Especially if there are no variables.
But whether it is invoked interactively or programmatically, in both cases it forces us to select a file. I chose an empty file, or non-json file - in both cases it gives an error :
impostman-import-file: End of file while parsing JSON: 1, 0, 0

Steps to reproduce

1. M-x impostman-import-file
2. Provide postman collection file
3. It asks for env file
4. Provide empty file
5. Error : impostman-import-file: End of file while parsing JSON: 1, 0, 0

Current behavior

Env file is not truly optional, even though it should be.

Expected behavior

Env file should be optional.Even if there are variables in the postman collection, the user should have the choice to import it anyway. It is far easier to edit the variables into actual values within emacs once it is in restclient or verb.

Suggested solutions

A. In interactive invocations when asking for env file, the default option should be "No env file". The user can then choose a file if needed.
B. In programmatic invocations, as by convention if latter arguments are not provided functions take default values instead of prompting the user. So programmatic invocation of (impostman-import-file "/path/to/postman/collection.json") should simply import the file without environment and defaulting to verb.

Additional information

NA


  • Impostman version (output of impostman-version): 
    "0.3.0-snapshot", got from MELPA today
  • Emacs version (output of emacs-version): 
    "GNU Emacs 30.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions