Closed ivtm86 closed 6 years ago
This is super weird. I can see you're using Windows and I've never tested it on that OS. I wonder if it has something to with slashes/backslashes difference in Windows/Unix, given that the error says it can't find the file.
Could you help me debug this issue? Your help here would be very valuable.
Hi, i want to try help make package windows usable. I moved yaml file to Project root and restart command again.
_snc .\swagger.yaml -o .\api
Now i get new Exception.
Aaww �. Something went wrong:
TypeError: Cannot read property 'basePath' of undefined
at swagger2 (C:\..\AppData\Roaming\npm\node_modules\swagger-node-codegen\lib\swagger2.js:57:30)
at <anonymous>
the Question is why swagger2.js file? My yaml file is wrote in openapi 3.0.0 version. Line 57 : swagger.basePath = swagger.basePath || ''; typeof swagger is undifined
Yeah, swagger2.js file name is just legacy stuff, but it's fine. This file is in charge of beautifying the swagger/openapi file. Honestly, I don't think the error is happening there, my guess is that your Swagger file is not being read at all. The reason I don't know.
Hi, just for information, I also tried to use it on Windows with OAS 3.0.0 inputs and it worked but with some problems:
So executing a second time will produce expected result but template folder is modified which is not expected.
@adrienucp you mean you tried this package or the openapi-generator package?
Sorry, I meant the openapi3-generator package: https://github.com/fmvilas/openapi3-generator.
This package
Yeah, what I mean is that this package is going to get deprecated soon, and wanted to know if you've tried https://github.com/fmvilas/openapi3-generator. Probably, it will solve the issues you're having. Sorry if I'm not of much help here, but I really don't have time to try it on Windows and figure out what's happening. Any help would be very appreciated.
Hi, if i try to start cli command snc .\swagger\swagger.yaml -o .\api i get displayed follow Exception:
Can not load the content of the Swagger specification file { Error: ENOENT: no such file or directory, open 'C:...\swagger\swagger.yaml' errno: -4058, code: 'ENOENT', syscall: 'open', path: 'C:\...\swagger\swagger.yaml' } Aaww �. Something went wrong: TypeError: Cannot read property 'basePath' of undefined at swagger2 (C:...\swagger-node-codegen\lib\swagger2.js:57:30) at
here is servers definition in yaml
_servers: url: http://localhost:10010/v1