subasraj / flashpost-support

Flashpost is a lightweight Rest API Client Extension for Visual Studio Code.
MIT License
10 stars 0 forks source link

Import of collection variables #52

Closed E4RIJMP closed 3 weeks ago

E4RIJMP commented 1 month ago

VSCode Version : 1.92.1 Flashpost Version : 1.1.81

Hello, thank you for Flashpost. I started using it today and have been enjoying it so far. But I ran into an issue: I imported a postman collection and it seems that the collection variables weren't imported. The collection file has over 2500 lines and is behind a paywall. So, I don't feel comfortable sharing the whole file but it basically looks like this:

{
  "info": { ... },
  "item": [ ... ],
  "event": [ ... ],
  "variable": [
        {
            "key": "url",
            "value": "https://localhost:5001"
        }
    ]
}

Trying to execute a request that uses the variable, e.g. {{url}}/api/users, causes an error: getaddrinfo ENOTFOUND undefined.

If I export the collection from Flashpost it does not seem to contain the variable anymore. So, I assume it was never imported into Flashpost.

Is the support of collection variables planned for the future? And is there a way to manually create such variables within Flashpost as a workaround? I added a global variable in the Environment tab of Flashpost for now but I would prefer a collection variable.

Regards

subasraj commented 3 weeks ago

@E4RIJMP You have to export the variables from postman(go to environments and export it) and import it into FlashPost

E4RIJMP commented 3 weeks ago

@subasraj The variable was exported from Postman. It is part of the collection file after the export (see code snippet in my first comment). But when importing the file to FlashPost the variable will not be imported.

subasraj commented 3 weeks ago

@E4RIJMP I have added the functionality to import variables found inside the collection now. Please try and leave a review for my extension if you like it.