node-red/node-red-nodegen

Another TypeError on OpenAPI 3.0 to OpenAPI 2.0 converted document

jdesai61 opened this issue · 3 comments

What are the steps to reproduce?

Get JIRA swagger 3.0 definition file

  wget https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json

Convert it to 2.0 using

 api-spec-converter -f openapi_3 -t swagger_2 https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json > swagger-jira-v2.json

Try to generate code using nodegen

node-red-nodegen swagger-jira-v2.json

What happens?

I get an error message
Error: TypeError: Cannot read property 'definitions' of undefined

What do you expect to happen?

I expect code to be generated per the README file

Please tell us about your environment:

  • Node generator version: 0.1.0
  • Node-RED version: v1.0.3
  • Node.js version: v13.7.0
  • npm version: 6.13.6
  • Platform/OS: Linux 4.4.0-18362-Microsoft x64 LE (WSL2 for Linux on Windows 10)
  • Browser: N/A

@jdesai61 The api-spec-converter command seems to output the invalid swagger file.
To avoid the problem, I used the jq command like the following to remove the definitions property.

Could you try this command?

@jdesai61 Thank you for your feedback. I will close this issue.