fmvilas / swagger-node-codegen

An OpenAPI 3.x/Swagger 2 code generator for Node.js
Apache License 2.0
200 stars 55 forks source link

UnhandledPromiseRejectionWarning: ReferenceError: req is not defined #48

Closed kloener closed 5 years ago

kloener commented 5 years ago

Hi,

I get an error when I generate a simple REST endpoint, because the variable "req" cannot be found correctly.

Affected File: https://github.com/fmvilas/swagger-node-codegen/blob/a884246059f3207da58be5a58c4c1a17f4e0313c/templates/express-server/src/api/routes/___.js#L62

I guess "reqtest" should be named to "req" instead.

Kind regards, Christian

fmvilas commented 5 years ago

You're right. This looks like a typo. Would you mind opening a PR?

kloener commented 5 years ago

Tested it with theses PR changes and it works :-)

fmvilas commented 5 years ago

It's already on npm, version 1.6.2. Thanks!