title: How to generate same matching rules for "arrayMinLike' using lambda Dsl for Pact?
body: <p>I have a sample body as below;</p>
  
  <pre><code>[
    "01/01/2019",
    "01/02/2019",
    "01/03/2019"
  ]
  </code></pre>
  
  <p>I'd like to validate the following:
  1. The response should be an array with <strong>at least 1 element</strong>
  2. Each element should be:
    2.1. String
    2.2. Should be in this format "DD/MM/YYYY"</p>
  
  <p>It works perfectly fine with the "old" style:</p>
  
  <pre><code>DslPart body = PactDslJsonArray.arrayMinLike(1, 2, PactDslJsonRootValue.stringMatcher(Constants.DATETIMEPATTERN, "01/01/2019"));
  </code></pre>
  
  <p>This would generate pact file with matching rules as below. Notice the <code>$</code> and <code>$[*]</code></p>
  
  <pre><code>...
                  "matchingRules": {
                      "body": {
                          "$": {
                              "matchers": [
                                  {
                                      "match": "type",
                                      "min": 1
                                  }
                              ],
                              "combine": "AND"
                          },
                          "$[*]": {
                              "matchers": [
                                  {
                                      "match": "regex",
                                      "regex": "^(([0-3]?\\d+)\\/((0?[1-9])|(1[0-2]))\\/20\\d{2})$"
                                  }
                              ],
                              "combine": "AND"
                          }
                      }
                  }
  </code></pre>
  
  <p>However, when I try with the "new" style, which is <strong>lambda Dsl for Pact (Java8)</strong>, it doesn't generate the same matching rules; hence doesn't work the same way and my provider test always fails with the below error message</p>
  
  <blockquote>
    <p>$ -> Expected a List with 1 elements but received 3 elements</p>
  </blockquote>
  
  <p>Below is the code and the matching rules that my code generate. Notice the <code>$[0]</code> and <code>$[1]</code>:
  Matching rules</p>
  
  <pre><code>...
  "matchingRules": {
                      "body": {
                          "$[0]": {
                              "matchers": [
                                  {
                                      "match": "regex",
                                      "regex": "^(([0-3]?\\d+)\\/((0?[1-9])|(1[0-2]))\\/20\\d{2})$"
                                  }
                              ],
                              "combine": "AND"
                          },
                          "$[1]": {
                              "matchers": [
                                  {
                                      "match": "type",
                                      "min": 1
                                  }
                              ],
                              "combine": "AND"
                          }
                      }
                  }
  </code></pre>
  
  <p>And the code</p>
  
  <pre><code>DslPart body = newJsonArray((array) -&gt; {
      array
              .stringMatcher(Constants.DATETIMEPATTERN, "01/01/2019");
  }).minArrayLike(1).build();
  </code></pre>
  
  <p>Tried another way</p>
  
  <pre><code>DslPart body = newJsonArray((array) -&gt; {
      array
              .stringMatcher(Constants.DATETIMEPATTERN, "01/01/2019")
              .minArrayLike(1);
  }).build();
  </code></pre>
  
  <p>I've been trying to place the <code>.minArrayLike(1)</code> in different places but none of them works. Is there anyway to produce the same matching rules using lambda Dsl for Pact?</p>