lib/apipie/validator.rb in apipie-rails-0.8.1 vs lib/apipie/validator.rb in apipie-rails-0.8.2

- old
+ new

@@ -78,10 +78,14 @@ # thor supported types :string, :hash, :array, :numeric, or :boolean def expected_type 'string' end + def ignore_allow_blank? + false + end + def merge_with(other_validator) return self if self == other_validator raise NotImplementedError, "Don't know how to merge #{self.inspect} with #{other_validator.inspect}" end @@ -331,10 +335,11 @@ def params_ordered @params_ordered ||= _apipie_dsl_data[:params].map do |args| options = args.find { |arg| arg.is_a? Hash } options[:parent] = self.param_description + options[:param_group] = @param_group Apipie::ParamDescription.from_dsl_data(param_description.method_description, args) end end def validate(value) @@ -474,9 +479,13 @@ end def description string = %w(true false 1 0).map { |value| format_description_value(value) }.join(', ') "Must be one of: #{string}." + end + + def ignore_allow_blank? + true end end class NestedValidator < BaseValidator