Hello all, we have a service that we're contract t...
# pact-net
f
Hello all, we have a service that we're contract testing and in it we have an end-point that returns an indeterminate amount of values in a array. Part of the consumer contrat is as follows
Copy code
"response": {
        "status": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8"
        },
        "body": {
          "revisionBaseline": 1,
          "baseProperties": [
            {
              "dataType": "",
              "defaultValue": "",
              "value": "",
              "valueOrigin": "",
              "key": ""
            }
          ]
        },
        "matchingRules": {
          "$.body.baseProperties[0].dataType": {
            "match": "regex",
            "regex": ".*"
          },
          "$.body.baseProperties[0].defaultValue": {
            "match": "regex",
            "regex": ".*"
          },
          "$.body.baseProperties[0].value": {
            "match": "regex",
            "regex": ".*"
          },
          "$.body.baseProperties[0].valueOrigin": {
            "match": "regex",
            "regex": ".*"
          },
          "$.body.baseProperties[0].key": {
            "match": "regex",
            "regex": ".*"
          }
        }
      }
    }
  ],
The problem is that it's just not 1 element but a array of them (at least 10+ of them) How can we setup an expectation on consumer side that would check this (that it receives an array of objects like this). Is it possible, and if it is, how can we set it up?
btw, the error in pactflow is:
Copy code
Actual array is too long and should not contain a Hash at $.baseProperties[1]
Actual array is too long and should not contain a Hash at $.baseProperties[2]
Actual array is too long and should not contain a Hash at $.baseProperties[3]
...
Actual array is too long and should not contain a Hash at $.baseProperties[34]
Actual array is too long and should not contain a Hash at $.baseProperties[35]
found the solution with Min Type matcher
👍 1