intridea/grape — pull request #390 by oivoodoo (2013-04-23 11:05:31+00:00)
Title: Add default value for the optional param

Hello.

Probably it's not a good way to specify default param using validators. But I haven't found another way for now.

What do you think about it?

```ruby
optional :type1, default: 'default-value1'
```

Test Examples:

```ruby
get '/' { params[:type1] }

get '/'
last_response.body.should == 'default-value1'

get '/?type1=passed-value'
last_response.body.should == 'passed-value'
```