pact-foundation / pact-stub-server

Standalone pact stub server
MIT License
75 stars 19 forks source link

Matching rules for arrays in query are not handled correctly #48

Closed pdeszynski closed 2 years ago

pdeszynski commented 2 years ago

Having an interaction with a request like

   "request": {
        "method": "GET",
        "path": "/endpoint/",
        "query": "ids=id&ids=id&ids=id",
        "matchingRules": {
          "$.query.ids": {
            "min": 2
          },
          "$.query.ids[*].*": {
            "match": "type"
          }
        }
      }

stub server will return 404 error when there's not an exact match for array length (so only request like /endpoint?ids=id&ids=id will be matched, but /endpoint?ids=id&ids=id&ids=id won't)

Expected behavior would be to return a response with minimum twice ids being defined. Tested on pact-stub-server:0.5.0 and pact-stub-server:v0.4.4

rholshausen commented 2 years ago

0.5.1 has been released with the fix

pdeszynski commented 2 years ago

@rholshausen works like a charm, thanks!

dheardal commented 2 months ago

This seems to have regressed in 0.6.0