lib/apipie/validator.rb in apipie-rails-0.2.3 vs lib/apipie/validator.rb in apipie-rails-0.2.4
- old
+ new
@@ -161,11 +161,11 @@
@items_type = options[:of]
@items_enum = options[:in]
end
def validate(values)
- return false unless process_value(values).respond_to?(:each)
+ return false unless process_value(values).respond_to?(:each) && !process_value(values).is_a?(String)
process_value(values).all? { |v| validate_item(v)}
end
def process_value(values)
values || []
@@ -173,10 +173,10 @@
def description
"Must be an array of #{items}"
end
- def self.build(param_description, argument, options={}, block)
+ def self.build(param_description, argument, options, block)
if argument == Array && !block.is_a?(Proc)
self.new(param_description, argument, options)
end
end