Skip to content

Commit

Permalink
Merge pull request #286 from dustint-rh/bool_type_validator
Browse files Browse the repository at this point in the history
Fixes #7284 - BooleanValidator set expected_type as boolean
  • Loading branch information
iNecas committed Sep 8, 2014
2 parents b8bf3a1 + 0223a90 commit 253d51b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/apipie/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ def self.build(param_description, argument, options, block)
end
end

def expected_type
'boolean'
end

def description
"Must be 'true' or 'false'"
end
Expand Down Expand Up @@ -444,6 +448,10 @@ def self.build(param_description, argument, options, block)
self.new(param_description, block, options[:param_group]) if block.is_a?(Proc) && block.arity <= 0 && argument == Array
end

def expected_type
'array'
end

def description
"Must be an Array of nested elements"
end
Expand Down

0 comments on commit 253d51b

Please sign in to comment.