Skip to content

Commit 53a373d

Browse files
committed
fix: removed undefined depth from query
1 parent 147a810 commit 53a373d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/pact/consumer_contract/query.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def self.normalize_params(params, name, v)
9999
else
100100
params[k] ||= {}
101101
raise ParameterTypeError, "expected Hash (got #{params[k].class.name}) for param `#{k}'" unless params_hash_type?(params[k])
102-
params[k] = normalize_params(params[k], after, v, depth - 1)
102+
params[k] = normalize_params(params[k], after, v)
103103
end
104104

105105
params

spec/lib/pact/consumer_contract/query_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ module Pact
2727
it "returns a nested map" do
2828
expect(subject).to eq "foo" => "bar2", "baz" => ["thing1", "thing2"]
2929
end
30+
31+
it "handles arrays and hashes" do
32+
expect(Query.parse_string("a[]=1&a[]=2&b[c]=3")).to eq "a" => ["1","2"], "b" => { "c" => "3" }
33+
end
3034
end
3135
end
3236
end

0 commit comments

Comments
 (0)