Add option to expand template tags in plugins and UI when exporting
See original GitHub issueIs your feature request related to a problem? Please describe.
Template tags are not been expanded when exporting data, I need it the most in a plugin (https://insomnia.rest/plugins/insomnia-plugin-documenter) when using context.data.export.insomnia
or context.data.export.har
and also it will be nice to have in the UI export too.
Describe the solution you’d like
For the plugin system, there can be a boolean option to enable expanding template tags before exporting so developers can do something like:
const data = await context.data.export.insomnia({
workspace,
format: 'json',
includePrivate: false,
expandTemplateTags: true,
})
And for the UI, it can simply be a checkbox when exporting.
Describe alternatives you’ve considered
I feel the above solution is the simplest we can ever get.
Additional context
This is what is currently happening when exporting with template tags and it doesn’t look good at all.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
Ah, I understand now, by
expansion
you meanevaluate
? So on export the evaluated result replaces the template tag expression? This definitely could be a good feature 👍Interesting, I can totally see the use case for it. Sometimes template tag expansion can also send requests, which I suppose is okay, but something to keep in mind. Provided expansion is added, perhaps you could prompt for the user to check/uncheck the option through your plugin (using a modal, for instance).
I’m not sure off the top of my head how tricky it may be to add expansion, though. I do not think it would be trivial.