We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f3ec04 commit 120a76fCopy full SHA for 120a76f
lib/grape-swagger/doc_methods/parse_params.rb
@@ -101,7 +101,7 @@ def param_type(value_type)
101
def parse_enum_or_range_values(values)
102
case values
103
when Proc
104
- parse_enum_or_range_values(values.call)
+ parse_enum_or_range_values(values.call) if values.parameters.empty?
105
when Range
106
parse_range_values(values) if values.first.is_a?(Integer)
107
else
spec/lib/parse_params_spec.rb
@@ -47,6 +47,14 @@
47
expect(parsed_range).to eql(enum: %w[a b c])
48
end
49
50
+
51
+ describe 'with arity one' do
52
+ let(:values) { proc { |v| v < 25 } }
53
+ specify do
54
+ parsed_range = subject.send(:parse_enum_or_range_values, values)
55
+ expect(parsed_range).to be_nil
56
+ end
57
58
59
60
describe 'values as Array -> enums' do
0 commit comments