Skip to content
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

Fail to generate nodes from Swagger v2 API json file #139

Open
6 tasks done
antoine-em opened this issue Dec 16, 2024 · 0 comments
Open
6 tasks done

Fail to generate nodes from Swagger v2 API json file #139

antoine-em opened this issue Dec 16, 2024 · 0 comments

Comments

@antoine-em
Copy link

What are the steps to reproduce?

What happens?

During the attempt to generate the nodes from the swagger.json (v2 format) the parser seems to crash for some reason.
I have checked on https://validator.swagger.io/ using the post request to verify the json validation and could get a green label.

> node-red-nodegen swagger.json           
                                
(node:72646) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: TypeError: Cannot read properties of undefined (reading 'definitions')
TypeError: Cannot read properties of undefined (reading 'definitions')
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/typescript.js:48:43
    at arrayEach (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:530:11)
    at Function.forEach (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:9410:14)
    at convertType (/usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/typescript.js:44:19)
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/typescript.js:62:32
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:3032:24)
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:4936:18
    at Function.forEach (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:9410:14)
    at Object.convertType (/usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/typescript.js:61:15)
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/codegen.js:184:24
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:3032:24)
    at /usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:4936:18
    at Function.forEach (/usr/local/lib/node_modules/node-red-nodegen/node_modules/lodash/lodash.js:9410:14)
    at getViewForSwagger2 (/usr/local/lib/node_modules/node-red-nodegen/node_modules/swagger-js-codegen-formdata/lib/codegen.js:180:7)

What do you expect to happen?

Having the node-generator parse the Swagger V2 file properly and/or give more information about the potential issue during the parsing.

Please tell us about your environment:

  • Node generator version: 0.2.4
  • Node-RED version: N.A.
  • Node.js version: v23.4.0
  • npm version: 10.9.2
  • Platform/OS: MacOS Sequoia
  • Browser: N.A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant