Skip to content

Importing OAS3 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mitasov-ra opened this issue Apr 12, 2023 · 1 comment
Open

Importing OAS3 #2

mitasov-ra opened this issue Apr 12, 2023 · 1 comment

Comments

@mitasov-ra
Copy link

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
Copy link
Owner

ts14ic commented Apr 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants