Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Javascript] Fix syntax issue when generating Javascript client operation without parameters #1690

Merged
merged 2 commits into from
Dec 9, 2015

Conversation

thibaultclem
Copy link
Contributor

When generating Client JS for an operation without parameters, an unnecessary comma is added before the callback parameter:

self.logoutUser = function(, callback) {

You can see the error directly on the generating UserApi.js:
https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/javascript/src/scripts/rest/api/UserApi.js#L233

My PR add a hasParams check before adding the comma and the PetStore example generating with the fix.

@wing328
Copy link
Contributor

wing328 commented Dec 9, 2015

@thibaultclem thanks for the PR. The fix looks good to me.

wing328 added a commit that referenced this pull request Dec 9, 2015
[Javascript] Fix syntax issue when generating Javascript client operation without parameters
@wing328 wing328 merged commit 7642314 into swagger-api:master Dec 9, 2015
@wing328 wing328 added this to the v2.1.5 milestone Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants