ts14ic / insomnia-plugin-path-parameter-tag

A template tag, that can be used inside URIs to as path parameters.
MIT License
1 stars 0 forks source link

Importing OAS3 #2

Open mitasov-ra opened 1 year ago

mitasov-ra commented 1 year ago

While inporting OAS3 spec with your plugin enabled all the path parameters are still converted to Insomnia Environment Variables.

Maybe there's a way to implement conversion from path parameters to tags?

ts14ic commented 1 year ago

As noted in #1 , I don't play around with Insomnia anymore, so I don't remember if this is possible or not...

It feels like if one wants to do that today, they'd have to define their own Insomnia importer for each possible import document type (OAS2, OAS3, all the different Postman collections). Not necessarily, but surely if OAS3 is supported, then someone would ask for other formats.

I base my judgement on these:

  1. Insomnia UI has this link in it hinting that previously it was possible to define your own importer. image
  2. I have a vague feeling it was previously possible to be done by a user provided plugin, but alas, the link leads here: https://docs.insomnia.rest/insomnia/import-export-data
  3. And it says: If you want to contribute new formats, feel free to submit a pull request to the insomnia-importers on GitHub.
  4. I cannot find the docs to define an importer any longer.

Back when I was playing with Insomnia, what I did, was I imported the collections I wanted, then modified imported collections with some shell scripts.

Also, the exporting would be a new symmetrical problem now to solve, where I'd need to teach Insomnia to treat the taggy path parameters from this plugin as path parameters. And this is something that Insomnia simply doesn't agree with. Again, as I mentioned in #1, I think the larger community wants per-request variables. There's no concept of "path parameters" in Insomnia, and as such there's no leverage for plugins to do anything special with path parameters (be it import/export/using them in requests in a handy way).

And this is why there are many path-parameters related plugins each doing their own thing, but ultimately each having their tradeoffs. If I'm not mistaken, the plugin made by the original Insomnia maintainer has the same OAS3 import problem that you describe