raml-javascript-generator
raml-javascript-generator copied to clipboard
fix for incorrect property name
Hello, everyone. Thank you for this module, I'm using it for my node JS project.
Recently I've got an error. My api contains url with zero as one of parts:
/api/0/someMethodName
And this causes error, because generated client contains code
this.0
This is correct url, but incorrect JS client code. So I suggest changing client template to safer property addressing through square brackets.
Thanks a lot. Not sure about the fix since it probably breaks some clients and would need a major release. I think at least.
Can you also add some tests, please?
@sichvoge I've change to example.raml - is enough. Without fix - generated JS is incorrect and will fail all tests.