node-red-nodegen icon indicating copy to clipboard operation
node-red-nodegen copied to clipboard

The default sample is failing node-red-nodegen http://petstore.swagger.io/v2/swagger.json

Open beejones opened this issue 4 years ago • 2 comments

What are the steps to reproduce?

Used the sample in your readme node-red-nodegen http://petstore.swagger.io/v2/swagger.json

What happens?

Error: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received an instance of Object TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received an instance of Object at validateString (internal/validators.js:124:11) at Url.parse (url.js:159:3) at Object.urlParse [as parse] (url.js:154:13) at dispatchHttpRequest (C:\dev\node red\node-red-nodegen\node_modules\axios\lib\adapters\http.js:66:22) at new Promise () at httpAdapter (C:\dev\node red\node-red-nodegen\node_modules\axios\lib\adapters\http.js:21:10) at dispatchRequest (C:\dev\node red\node-red-nodegen\node_modules\axios\lib\core\dispatchRequest.js:52:10) at getSpec (C:\dev\node red\node-red-nodegen\lib\swagger\index.js:26:28) at Object.module.exports [as SwaggerNodeGenerator] (C:\dev\node red\node-red-nodegen\lib\swagger\index.js:53:16)

What do you expect to happen?

It should generate nodes

Please tell us about your environment:

  • [x] Node generator version: 0.1.0
  • [x] Node-RED version:Node-RED v1.2.6
  • [x] Node.js version:v14.15.1
  • [x] npm version:.14.8
  • [x] Platform/OS: windows 10 Version 10.0.19042.746
  • [x] Browser: edge

beejones avatar Jan 16 '21 12:01 beejones

The sample is working just fine for me using ubuntu.

t-huyeng avatar Jan 29 '21 12:01 t-huyeng

Maybe you need the extra step for Windows. Have a look at https://kazuhitoyokoi.medium.com/procedures-to-develop-node-red-node-from-openapi-document-8685fdc7e90a

j2l avatar Feb 08 '21 20:02 j2l