title: Define Contract DSL to send count of JSON elements from request into response
body: <p>I have contract defined for the spring cloud contract testing. I am sending JSON in request body and want to return the count of 'keyValues' in the response 'responseMsg'.</p>
  
  <p>I am able to return the 'keyValues' in 'requestedKeys' but unable to get the count. Any help would be appreciated.</p>
  
  <pre><code>import org.springframework.cloud.contract.spec.Contract
  
  
  Contract.make {
  
  
      name("lockUnlockKeys")
  
      request {
          method(POST())
          url("/api/v1.0/license/lockunlockkeys")
          headers {
              header 'Content-Type': 'application/json'
          }
          body(
                  [
                          "keyValues":
                                  [
                                          "0048Q-0MK1N-38V8C-013KP-0NQ00",
                                          "00497-4MK17-38V82-0L28M-11Q24"
                                  ],
                          "lockflag": matching(regex("[YN]{1}"))
                  ]
          )
          bodyMatchers {
              jsonPath('$.keyValues', byType {
                  minOccurrence(1)
              })
          }
      }
      response {
          status(200)
          body(
                  [
                          "requestedKeyList": value(fromRequest().body('$.keyValues')),
                          "responseMsg": ?????????
                  ]
          )
          headers {
              header 'Content-Type': 'application/json'
          }
      }
  }
  </code></pre>
  
  <p>Any suggestions in place of '???????'</p>