You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's an interesting proposal, and I definitely see the use case. However, I'm a bit skeptical about the specific implementation for two reasons:
It would break the JSON specification, and therefore the compatibility with the REST clients on VSCode, IntelliJ, Postman and the likes.
It would open the doors to potential command injection, especially when the command can contain references to external variables - and let's not even get started on everything that can go wrong when parsing the command or injecting its output into the JSON...
Perhaps this could work better if implemented through standard shell environment variables. Two possible ways to implement it:
The simple way - you run export jwt_token="$(gopass show pass/mytoken)" before running neovim, and the existing environment variables are joined to the lookup map, so you can use ${jwt_token} in your requests. Support for .env files is also on my roadmap, but I don't think it would solve your specific use-case - you need dynamic, not static variables.
With custom pre-request scripts - defined either per-environment or on global level. Something along the lines of:
This would actually be quite powerful because it would enable to run any custom logic before a request (not only variables), and it may also allow for an __after__ script that can e.g. cleanup things after a request.
@blacklight thanks for the feedback, I totally agree that my proposed implementation is not relevant, it was more to get the idea.
In my workflow, the first and easiest implementation is the best : I use a "lightweight workspace manager" (https://github.com/jamesob/desk), in fact mainly a bunch of shell script setting environment variables. I can rely on this variables to pimp the JSON.
Congrats for the great work on this plugin !
Would it be worth considering to use a command for the json variables values ? ie something like :
The text was updated successfully, but these errors were encountered: