wcandillon / swagger-js-codegen

A Swagger Codegen for typescript, nodejs & angularjs
Apache License 2.0
693 stars 286 forks source link

Paths with a period result in error during codegen #80

Open jdhiro opened 9 years ago

jdhiro commented 9 years ago

Paths with a period in them, such as a version number, result in an error:

/Users/jason/dev/pi/pi-codegen/node_modules/swagger-js-codegen/lib/codegen.js:214
            throw new Error(lint.errors[0].reason + ' in ' + lint.errors[0].evidence);
            ^

Error: Unexpected '.'. in  Test.prototype.getFeedsMapsV1.4Venues = function(parameters){
    at /Users/jason/dev/pi/pi-codegen/node_modules/swagger-js-codegen/lib/codegen.js:214:19
    at Array.forEach (native)
    at getCode (/Users/jason/dev/pi/pi-codegen/node_modules/swagger-js-codegen/lib/codegen.js:212:17)
    at Object.exports.CodeGen.getNodeCode (/Users/jason/dev/pi/pi-codegen/node_modules/swagger-js-codegen/lib/codegen.js:225:16)
    at Object.<anonymous> (/Users/jason/dev/pi/pi-codegen/app.js:6:32)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:471:10)

The path in question was /feeds/maps/v1.4/venues

Quoting the path, or trying to escape the period doesn't work.

wcandillon commented 9 years ago

@jdhiro Can you provide an input swagger file to add to the test suite when we fix this issue?

jdhiro commented 9 years ago

@wcandillon you bet, I'll get it together