Skip to content
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

Importing from Insomnia #125

Open
ashitaprasad opened this issue Feb 22, 2024 · 5 comments · May be fixed by #525
Open

Importing from Insomnia #125

ashitaprasad opened this issue Feb 22, 2024 · 5 comments · May be fixed by #525
Labels
enhancement New feature or request good first issue Good for newcomers import-export Import into from other formats & Export from API Dash priority: high

Comments

@ashitaprasad
Copy link
Member

ashitaprasad commented Feb 22, 2024

Tell us about the task you want to perform and are unable to do so because the feature is not available
Insomnia is an open source desktop application for API design, debugging and testing. We look forward to supporting API data import from the Insomnia platform. It would include importing requests, allowing users to select the requests that he wants to add to API Dash and let users choose the insomnia environment to be imported.

@ashitaprasad ashitaprasad added enhancement New feature or request good first issue Good for newcomers import-export Import into from other formats & Export from API Dash labels Feb 22, 2024
@ashitaprasad
Copy link
Member Author

Update: The frontend is already implemented.
The only change required will be the addition on Insomnia in ImportFormat enum and adding the parser code.

@kumar-piyush12
Copy link

kumar-piyush12 commented Dec 21, 2024

Hi ma'am, I want to contribute to this issue. I am contributing for the first time and I went through CONTRIBUTING.md for guidelines. Please share some approach to solve this problem.

@ashitaprasad
Copy link
Member Author

@kumar-piyush12 You can take a look at other importers currently available in API Dash. Go through the Insomnia format spec and suggest your approach for solving this issue.

@StormGear
Copy link
Contributor

StormGear commented Jan 6, 2025

This is marked as a good first issue and high priority. I took it upon myself to do some work on it. This is my approach, similar to already existing importers.

  1. Implemented an InsomniaCollection class for defining the structure of the insomnia v4 format spec.
  2. In insomnia, the Requests and other details about insomnia workspace are included in the "resources" field of the json exported file.
  3. It is worthwhile to note that not all objects in the json are actually requests, hence some logic is written to only use "resources" which are marked "_type":"request"
  4. The obtained requests are then mapped to HttpRequestModel Object of the APIDash codebase.
  5. The format spec of v4 is not quite consistent, i.e it's json structure may vary, this introduced a few complexities when building the insomnia model.

Here I show practically, an insomnia v4 json format file being imported into APIDash and working quite well.

insomia_import.zip

I'd like to send in a draft pull request, so you can have it reviewed. Thanks

@ashitaprasad
Copy link
Member Author

@StormGear you can send across a draft PR for review.

@StormGear StormGear linked a pull request Jan 6, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers import-export Import into from other formats & Export from API Dash priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants