def refine_params_description(params_desc, recorded_params)
recorded_params.each do |key, value|
params_desc[key] ||= {}
param_desc = params_desc[key]
if value.nil?
param_desc[:allow_nil] = true
else
unless param_desc[:type]
param_desc[:type] = [:bool, :number]
param_desc[:type] << Hash if value.is_a? Hash
param_desc[:type] << :undef
end
if param_desc[:type].first == :bool && (! [true, false].include?(value))
param_desc[:type].shift
end
if param_desc[:type].first == :number && (key.to_s !~ /id$/ || !Apipie::Validator::NumberValidator.validate(value))
param_desc[:type].shift
end
end
if value.is_a? Hash
param_desc[:nested] ||= {}
refine_params_description(param_desc[:nested], value)
end
end
end