Closed mefellows closed 2 years ago
Looks like there are multiple problems here:
String -> String: comparing '["1"]' to '2'
Thanks Ron.
For (1), are you saying that Pact JS (and other clients) should send the query in a different shape or is this some internal thing in the rust core?
Both. Defect in the Rust core and we should change the payload being sent.
Thanks. Because my brain is still not working, what would be the correct JSON payload shape to send for the query? I think I tried a few variations.
I've added a new function that takes
{
"value": ["1"],
"pact:matcher:type": "type",
"min": 1
}
I'm trying to setup an array matcher on a repeated query string value, but I always end up with the following error:
It's currently part of a semi-regression suite we run in Pact JS. I've ported the beta branch legacy interface to use the rust core, so that most users should be able to just upgrade without having to modify all of their tests.
The setup looks a bit like this:
This would produce a
query
matcher in JSON format as follows:The request being sent is
GET /cats?catId[]=2&catId[]=3
.What I've tried
catId=1&catId=2...
syntax as well as the rails array syntaxcatId[]=1&catId[]=2...
yield the same resulttype
matcher, rather than an array matcher (it looks like query params are always treated as arrays, so I suspected maybe that interfered with the matching rule logic)Debug logs: