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

path template with hypen produces invalid json object in the routes file #35

Closed ghost closed 6 years ago

ghost commented 6 years ago

OAS3 definition file snippet: "/accessories/{accessory-id}/open": { "description": "Represents the custom \"Open\" operation", "post": {

Generates a const in a routes file that looks like this: const options = { languageCode: req.query.languageCode, localAccessDesired: req.query.localAccessDesired, inputOutputCallback: req.query.inputOutputCallback, contentFilter: req.query.contentFilter, accessory-id: req.params.accessory-id };

accessory-id is invalid and needs to be surrounded with quotes.

I really like this tool and want to use it in my CI/CD setup.

fmvilas commented 6 years ago

Sorry for the late response. Good catch, will try to fix it as soon as I can. If you have time to fix it I'd really appreciate a PR.