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

Unable to send 0 or false to number/boolean arguments in custom method #349

Closed
2 of 6 tasks
mahendranvm opened this issue Feb 6, 2017 · 3 comments · Fixed by #387 or #440
Closed
2 of 6 tasks

Unable to send 0 or false to number/boolean arguments in custom method #349

mahendranvm opened this issue Feb 6, 2017 · 3 comments · Fixed by #387 or #440

Comments

@mahendranvm
Copy link

mahendranvm commented Feb 6, 2017

What type of issue are you creating?

  • Bug
  • Enhancement
  • Question

What version of this module are you using?

  • 2.0.10 (Stable)
  • 2.1.0-rc.n (2.1 Release Candidate n)
  • Other

Write other if any:

Please add a description for your issue:

I have a custom method that takes a required boolean and number type arguments. The generated sdk creates urlParams like this "if(argX) _urlParams.argX = argX". So when I pass 0s (or FALSEs) to argX, they are not getting added to urlParams resulting in 400 Errors. Should the check be rather for undefined or null rather than like this: if (typeof argX !== 'undefined' && argX !== null) _urlParams.argX = argX

@jonathan-casarrubias
Copy link
Collaborator

thanks for reporting I will need to add a unit test for this an verify the issue

@mahendranvm
Copy link
Author

Hi, thanks for the updates. This is marked closed, but rc.9 still produces urlParams like below:
if (${param.arg}) _urlParams.${param.arg} = ${param.arg};

So, it the value passed is a 0 or false, the parameter is still not attached.

@jonathan-casarrubias
Copy link
Collaborator

yeah not sure what happened, I did fix this but I'm seeing the result and the changes are not there in the release...

I'll open it again and send the fix in the next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment