krakenjs / generator-swaggerize

Yeoman generator for design-driven apis with swagger 2.0 and krakenjs/swaggerize tools.
Other
69 stars 34 forks source link

yo swaggerize after wizard throws Error code: "EISDIR" #67

Closed fa8ster closed 8 years ago

fa8ster commented 8 years ago

voila_capture 2016-02-03_01-50-40_pm

➜  transparent-production  yo swaggerize                
Swaggerize Generator
? What would you like to call this project: transparent-production
? Your name: 
? Your github user name: 
? Your email: 
? Path (or URL) to swagger document: 
? Express, Hapi or Restify: express
readline.js:924
            throw err;
            ^

Error: Unable to read "/Users/fabianhenzler/Development/transparent-production" file (Error code: EISDIR).
    at File.read (/Users/fabianhenzler/.node/lib/node_modules/generator-swaggerize/node_modules/file-utils/lib/file.js:253:11)
    at File.readJSON (/Users/fabianhenzler/.node/lib/node_modules/generator-swaggerize/node_modules/file-utils/lib/file.js:259:18)
    at loadApi (/Users/fabianhenzler/.node/lib/node_modules/generator-swaggerize/app/index.js:389:56)
    at null.<anonymous> (/Users/fabianhenzler/.node/lib/node_modules/generator-swaggerize/app/index.js:129:28)
    at PromptUI.onCompletion (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/inquirer/lib/ui/prompt.js:57:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1550:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1489:14)
    at Subject.Rx.Subject.addProperties.onCompleted (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5871:19)
    at Subject.tryCatcher (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.completed (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5796:56)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/fabianhenzler/.node/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1489:14)
subeeshcbabu-zz commented 8 years ago

I am wondering the swagger file API definition was not provided here. Path (or URL) to swagger document: is mandatory input. Scaffolding of the application is based on this input.

Having said that the error message should have been conveying the appropriate details instead of just bomb.

fa8ster commented 8 years ago

Is there a way to debug it like a /verbose flag or something?

bengwall commented 8 years ago

I got the same error. As stated above, to solve it I (1) copied my swagger.json file to the directory in which I was running yo and (2) specified "swagger.json" in the "Path to swagger document" prompt.

subeeshcbabu-zz commented 8 years ago

Please check the latest version generator-swaggerize@3.0.0. This should be resolved. The apiPath cannot be empty anymore.