-
Notifications
You must be signed in to change notification settings - Fork 365
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
Added insomia importer #525
base: main
Are you sure you want to change the base?
Conversation
lib/consts.dart
Outdated
@@ -141,7 +141,8 @@ enum CodegenLanguage { | |||
|
|||
enum ImportFormat { | |||
curl("cURL"), | |||
postman("Postman Collection v2.1"); | |||
postman("Postman Collection v2.1"), | |||
insomia("Insomnia v4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insomia
-> insomnia
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And correct it everywhere else.
@@ -1,2 +1,3 @@ | |||
export 'curl_io.dart'; | |||
export 'postman_io.dart'; | |||
export 'insomia_io.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling of insomnia is incorrect.
packages/insomnia/pubspec.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename package name to insomnia_collection
and change it everywhere as insomnia
package name is not available on pub.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you change the name of the folder too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the folder should be collection_examples
not collection_examples.dart
The Dart model is incomplete and does not handle environments and body of content type formdata. |
All points well noted, I'll make the needed modifications and revert. Thank you. |
…edList and isParamEnabledList to the Header and Parameter Model
The Dart model is now complete with content type formdata. Also the model now is able to determine values for isHeaderEnabledList and isParamEnabledList. However, I'm still working to implement the environment and I would add that commit soon. |
Sure @StormGear 👍 |
@ashitaprasad Please I would like to ask a clarifying question, when importing, does one need to navigate to the "Variables" section to import the environment or when the collection is imported the environment it contains should be automatically added? PS: To import environment in Postman, one has to navigate to the environment section and import the environment there separate from importing collections. |
The most important thing is to build insomnia collection model properly such that all data is parsed properly and stored in the Dart model.
You can add import feature in env variables too in a separate PR. |
PR Description
Importer for Insomnia v4 json format for importing into APIDash
Add your description
Insomnia offers the feature to export APIs collection in various formats such as v4 and yaml. In this PR, I implemented importer for Insomnia v4 which is a json format, similar to already existing postman importer. The format specification is not very consistent compared to the export files from Postman. However I managed to implement a working example.
Related Issues
Checklist
main
branch before making this PRflutter upgrade
and verify)flutter test
) and all tests are passingAdded/updated tests?
Added unit tests for converting json str and json object to InsomniaCollection which is the model used for converting v4 to Dart.
OS on which you have developed and tested the feature?