Error when importing Swagger 2.0 json file
See original GitHub issueDescribe the bug When trying to import a Swagger 2.0 json file, I get the following error:
The file does not contain a valid specification.
StackTrace
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, Buffer, TypedArray, or DataView. Received type undefined
at Hash.update (internal/crypto/hash.js:70:11)
at importFolderItem (/Applications/Insomnia.app/Contents/Resources/app.asar/node_modules/insomnia-importers/src/importers/swagger2.js:161:6)
at /Applications/Insomnia.app/Contents/Resources/app.asar/node_modules/insomnia-importers/src/importers/swagger2.js:129:12
at Array.map (<anonymous>)
at parseEndpoints (/Applications/Insomnia.app/Contents/Resources/app.asar/node_modules/insomnia-importers/src/importers/swagger2.js:128:46)
at Object.module.exports.convert (/Applications/Insomnia.app/Contents/Resources/app.asar/node_modules/insomnia-importers/src/importers/swagger2.js:68:21)
at async module.exports.convert (/Applications/Insomnia.app/Contents/Resources/app.asar/node_modules/insomnia-importers/index.js:19:23)
at async importRaw (file:///Applications/Insomnia.app/Contents/Resources/app.asar/bundle.js:42846:15)
at async Object.importUri (file:///Applications/Insomnia.app/Contents/Resources/app.asar/bundle.js:42808:18)
at async file:///Applications/Insomnia.app/Contents/Resources/app.asar/bundle.js:79047:24
Expected behavior File should import without issues.
Desktop (please complete the following information):
- OS: MacOS 10.15.7
- App Version: 2020.4.1
Additional context
- The Swagger Editor does find several warnings, but no errors, so the file should parse.
- The file is in JSON format, not YAML.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Encounter error when import swagger json to create multiple ...
Hi guys,. I want to consume a REST API which created by Mule, but when i added multiple methods by importing the swagger...
Read more >Cannot import swagger 2.0 file anymore (it was working ...
Hello, I'm trying to import a swagger (yaml or json) file generate ... 2 ~ Failed to import Swagger 2.0”,“Error importing Swagger 2.0...
Read more >Error while Importing - json swagger file - Oracle Communities
When trying to import the swagger file in web tools, we got below error. I did check for the error and could find...
Read more >Cannot import swagger 2.0 JSON file into smartdocs model
You should have a `swagger` directive in your openapi spec, not "openapi", that could be the problem. Another option is to convert to...
Read more >Could not import" error while importing NSX-T API Spec into ...
"Error while importing Swagger 2.0: Could not import" error while importing NSX-T API Spec into Postman (74984) ... This issue occurs due to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Workaround:
Same here, the error got solved.