ImportSpec error is not handle
See original GitHub issueWe should not destructure the param here -> https://github.com/contiamo/restful-react/blob/master/src/scripts/import-open-api.ts#L213
This can cause this kind of error:
> restful-react import --file ../documentation/docs/reference/api/idp.swagger.json --output src/components/queries/idp.tsx --transformer schema-transformer.js
/Users/lucasroesler/Code/contiamo/idp/ui/node_modules/restful-react/lib/bin/restful-react-import.js:249
var openapi = _a.openapi;
^
TypeError: Cannot read property 'openapi' of undefined
at /Users/lucasroesler/Code/contiamo/idp/ui/node_modules/restful-react/lib/bin/restful-react-import.js:249:34
at /Users/lucasroesler/Code/contiamo/idp/ui/node_modules/call-me-maybe/index.js:13:28
at processTicksAndRejections (internal/process/next_tick.js:74:9)
at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:5
If something we have an error, the program break before the actual error handler 😅
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
while checking deployment option: invalid ovf ... - GitHub
I have noticed another (minor) issue that I will create a new ticket for though: the vsphere provider does not handle vApp Properties...
Read more >How to Fix an Import Specification Error in Microsoft Access
“Run-Time error '3625': The text file specification 'My Saved Access Import Spec' does not exist. You cannot import, export, or link using ...
Read more >Handling possible type of import errors - python - Stack Overflow
I am trying to handle possible errors seen during import operations at the beginning of the execution of python program.
Read more >Import Spec Sections to the Admin Tool - Procore Support
How to bulk import project spec sections if your company has NOT enabled the Specifications tool on a project.
Read more >Managed Object - OvfManager(vim.OvfManager) - VMware
Error handling. All result types contain warning and error lists. Warnings do not cause processing to fail, but the caller (typically, the user...
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 Free
Top 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
Any word on when this might be fixed? I’ve messed around with this a bit and found a potential solution, but I’m unsure of the downstream effects.
It seems like this is caused in the definition for swagger2openapi.d.ts, which needs to define
data
as optional for theconvertObj
callback to be valid.swagger2openapi
appears to use the call-me-maybe library, which follows gives the following response:The downstream effect that I can predict for this is that offending block needs to look more like this, as de-structuring no longer works when you fix the interface.
I don’t really like the way this looks and I’m not sure if there is any case where an
undefined
would be passed into resolve, however, in theory it would only happen onerr
anyway.The real question is always, are yours specs really valid or the linter is failing? (I’m asking because we had the case previously, and appear that was a hole in the linter…)
Whatever, if you have a fix I will review your PR with pleasure before christmas, otherwise I will try to apply your solution on monday 😉