diff --git a/lib/httparty/hash_conversions.rb b/lib/httparty/hash_conversions.rb index 270effe3..a888db0e 100644 --- a/lib/httparty/hash_conversions.rb +++ b/lib/httparty/hash_conversions.rb @@ -54,11 +54,9 @@ def self.normalize_keys(key, value) stack.each do |parent, hash| hash.each do |child_key, child_value| if child_value.respond_to?(:to_hash) - stack << ["#{parent}[#{child_key}]", child_value.to_hash] + normalized_keys += normalize_keys("#{parent}[#{child_key}]", child_value) elsif child_value.respond_to?(:to_ary) - child_value.to_ary.each do |v| - normalized_keys << normalize_keys("#{parent}[#{child_key}][]", v).flatten - end + normalized_keys += normalize_keys("#{parent}[#{child_key}]", child_value) else normalized_keys << normalize_keys("#{parent}[#{child_key}]", child_value).flatten end