vigetlabs / gangway

A client-side API abstraction layer
MIT License
13 stars 1 forks source link

Allow Number 0 to be passed as a param #18

Closed greypants closed 8 years ago

greypants commented 8 years ago

Feels on this @nhunzaker? Any reason params should have to be strings? I noticed you were doing that in the examples, but didn't see any documentation saying that you must.

API.users.read({ params: { id: 0 } })

The above currently fails, since params[0] evaluates to false.

nhunzaker commented 8 years ago

Ack. This is without a doubt a bug. I should have known better. Could you add test coverage?

averyvery commented 8 years ago

:+1:

cwmanning commented 8 years ago

:+1:

nhunzaker commented 8 years ago

This should be taken care of in 1.0. I've also added test coverage here:

https://github.com/vigetlabs/gangway/commit/09e3cbb4ab8d7e787b9c71c31f33f9c7234d608e