krakenjs / generator-swaggerize

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

Swagger spec file seems to always be called pets.json in index.js #4

Closed MrWako closed 9 years ago

MrWako commented 9 years ago

Hi folks, thanks for creating the generator-swaggerize package, it was just what I was looking for. Spotted a couple of small things that I thought you might be interested in - I'll log them as separate issues.

So if I take a copy of https://raw.githubusercontent.com/wordnik/swagger-spec/master/examples/v2.0/json/petstore.json and save it locally, changing the name to api.json. Then I run the generator (latest version installed from source code rather than npm package) the index.js file expects to find pets.json, not api.json.

app.use(swaggerize({ api: require('./config/pets.json'), handlers: './handlers' }));

Thanks.

tlivings commented 9 years ago

This was hard coded, yuck. Thanks.

tlivings commented 9 years ago

Fixed in generator-swaggerize@1.0.0-alpha.10

MrWako commented 9 years ago

great thanks.

MrWako commented 9 years ago

Just installed the latest version via npm, I think the "./" might have gone missing from the config path. I'm currently getting

api: require('config/swagger.json')

rather than

api: require('./config/swagger.json')

Only minor, thanks.