node-red/node-red-nodegen

Error: TypeError: Cannot read property 'forEach' of undefined

tedstriker opened this issue · 1 comments

What are the steps to reproduce?

running nodejs von osx
run the command:
node-red-nodegen https://raw.githubusercontent.com/grocy/grocy/6c7420ea08ba589d339b380db2f30f153ec2ef12/grocy.openapi.json

What happens?

the directories icons, locales, test are created, but contain no code.
Error: TypeError: Cannot read property 'forEach' of undefined is thrown

What do you expect to happen?

a node to be created like with your petstore example in best case.
a more helpful error msg at least.

Please tell us about your environment:

  • [ 0.0.4 ] Node generator version:
  • [ 1.0.3 ] Node-RED version:
  • [ 8.16.1 ] Node.js version:
  • [ 6.13.4 ] npm version:
  • [ osx ] Platform/OS:
  • [ chrome ] Browser:

@tedstriker Thank you for your report. Currently, Node generator doesn't support Swagger version 3 (It supports Swagger version 2 only). To convert version 2 to version 3, api-spec-converter command will be useful. There's document about it on the following wiki page
https://github.com/node-red/node-red-nodegen/wiki#openapi-specification-30

In the commit, 442b82d, I added error messages which users can understand when encountering an unsupported format.