Closed VentyCZ closed 4 years ago
Created a PR for that.
@sjwilczynski Thanks for the fix! So it will generate methods like getroot(), right ?
Thanks for reporting @VentyCZ, and thanks for the PR @sjwilczynski - Will take a look today
Merged and published as 3.0.3. Thanks @sjwilczynski! Please reopen if it doesnt solve the problem for you @VentyCZ
@sjwilczynski Thanks for the fix! So it will generate methods like getroot(), right ?
@VentyCZ After some changes we decided on methods names like rootEndpoint_${lowerCasedHttpVerb}
- the http method comes after so that there is no conflict when someone has an endpoint called "rootEnpoint"
Just tried to integrate this library into my project and I just found a case where the library fails.
There is an issue with the getPathToMethodName function.
When I have a root path (/) in the paths object of the spec, the library crashes: "Cannot read property 'toUpperCase' of undefined".
It's caused by line 116, but originates from line above.
If the result variable is an empty string it throws.
I "fixed" it by doing this before calling the getTypescriptCode function:
This solution fixes the issue partially, because now the target path in the generated code is wrong.
The solution to the issue might be using an alias for the / path, like index for example.