krakenjs / swaggerize-express

Design-driven apis with swagger 2.0 and express.
Other
355 stars 81 forks source link

Api Path Generation Wrong in Windows #66

Closed Leyart closed 8 years ago

Leyart commented 9 years ago

Under Windows, the path generated by Swaggerize in server.js is wrong, since it returns something in the like of:

api: path.resolve('./config\swagger.json'),

Note: error in ./config\, which should be ./config/

The same happens in all the automated tests generated, which is a rather more serious problem

Leyart commented 9 years ago

The problem is related to the fact that the path is generated as a string by using path.join and the like. On windows this results in a path that will have all the backslashes escaped:

.\test\api\something.json

when used in the templates, this will turn into:

.\test\api\something.json

thus the backslashes will be considered as simple escape characters.

tlivings commented 9 years ago

Sounds like this issue belongs to generator-swaggerize.

tlivings commented 8 years ago

Closing now that we are tracking in generator.