diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cbf95193..b2a1fa13d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Next Release * [#557](https://github.com/intridea/grape/pull/557): Pass `content_types` option to `Grape::Middleware::Error` to fix the content-type header for custom formats. - [@bernd](https://github.com/bernd). * [#585](https://github.com/intridea/grape/pull/585): Fix after boot thread-safety issue - [@etehtsea](https://github.com/etehtsea). * [#587](https://github.com/intridea/grape/pull/587): Fix oauth2 middleware compatibility with [draft-ietf-oauth-v2-31](http://tools.ietf.org/html/draft-ietf-oauth-v2-31) spec - [@etehtsea](https://github.com/etehtsea). +* [#610](https://github.com/intridea/grape/pull/610): Fixed group keyword was not working with type parameter - [@klausmeyer](https://github.com/klausmeyer/). 0.6.1 (10/19/2013) ================== diff --git a/lib/grape/validations.rb b/lib/grape/validations.rb index f843dd11ce..624f286e3c 100644 --- a/lib/grape/validations.rb +++ b/lib/grape/validations.rb @@ -132,8 +132,8 @@ def optional(*attrs, &block) push_declared_params(attrs) end - def group(element, &block) - requires(element, &block) + def group(*attrs, &block) + requires(*attrs, &block) end def params(params) diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index fe67044a1e..dff7c9560d 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -1948,6 +1948,13 @@ def self.call(object, env) } ] end + it 'allows to set the type attribute on :group element' do + subject.params do + group :foo, type: Array do + optional :bar + end + end + end it 'parses parameters when no description is given' do subject.params do requires :one_param, desc: "one param"