elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 85 forks source link

Boolean param type issue #19

Closed Cifer-Y closed 8 years ago

Cifer-Y commented 8 years ago

In my API route, I have a param like below:

    params do
      requires :opt_in, type: Boolean
    end

Then I visit my api, I found a strange question:

If my param is {"opt_in": false}, it will report that I didn't pass opt_in to it.

But {"opt_in": true}, {"opt_in": "true"}, {"opt_in": "false"} all worked well.

Confused.