Skip to content

Commit

Permalink
(Attempt to) address PR comments: make param_type_is_array? more ex…
Browse files Browse the repository at this point in the history
…plicit
  • Loading branch information
TySpring committed Jun 16, 2016
1 parent c3397c2 commit 95d0ec1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/grape-swagger/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ def parse_request_params(required)

def param_type_is_array?(param_type)
return false unless param_type
param_type == 'Array' || param_type =~ /\[\w+\]\z/
return true if param_type == 'Array'
param_types = param_type.match(/\[(.*)\]$/)
return false unless param_types
param_types = param_types[0].split(',') if param_types
param_types.size == 1
end

def expose_params_from_model(model)
Expand Down

0 comments on commit 95d0ec1

Please sign in to comment.