Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature/swagger2 importer #695
Swagger 2.0 importer
Hi! I'm super happy to share with you first version of swagger (aka OpenAPI) importer implementation. For now it supports only swagger version
What it does?
Creates requests based on endpoints definitions in swagger file. My goal was to do that in the most usefull way, in the same time keeping it simple so it does not force users use model that does not dit their way of work.
... what's more:
This PR heavily depend on my other PR - Async importers (#694). Under the hood, the importer uses https://github.com/BigstickCarpet/swagger-cli for specification dereferencing. This library is asynchronous, which makes the importer is also asynchronous.
I'm very fresh user of Insomnia, so I'm not sure if my approach is correct. If you have any suggestions, feel free to share!
This is actually feature I wanted to implement since the beggining, however I'm not sure if this is something most of the users would like to use. In case of simple APIs this additional structure would probably add some clarity, however in case of complex interfaces it may have opposite result, as we are using only first tag.
I also thought about other solution, where we create copy of a request for each tag, so if endpoint has multiple tags, it is available in every related folder (this is how swagger-ui works). But there would be a side effect - if there was a need to update request, user would need to update each of them separately.
I'm more than happy to add "request groups", let's just wait for other opinions, to figure out what would be most beneficial for everyone :) Thanks for you feedback!
@slawus I get the same issue when I import REST API for Oracle Eloqua Marketing Cloud Service in Version 5.14.9 (188.8.131.525)
* Added support for async importers * Swagger importer v0.1 - supports import of workspace, environment and endpoints from swagger 2.0 specifications. Supports query params, headers and body. Mocks body of application/json endpoitns * Refactor: added comments, removed function-in-function declarations * Fixed import of yaml files. Added tests for both .json and .yaml