title: Wiremock - how to match all permutations of array elements of a multipart/form-data in JSON?
body: <p>I'm trying to mock a YAML API using JSON Wiremock for a PUT multipart/form-data. The multipart contains two arrays of metadata. How can I match a set of specific values (or regex) in each array, disregarding of the order. </p>
  
  <p>We are bound to use YAML 2.0 (if you wonder), which is why we have these two arrays for the metadata. I've been able to successfully match specific values for the array (for example, for fileMetadataName, I can match "permissions,owner"), but I haven't found how to match the full set of potential values (5 values with all possible permutations, see YAML below).</p>
  
  <p>Here is the JSON Wiremock file that can match one case of the array:</p>
  
  <pre><code>{
          "request": {
                  "method": "PUT",
                  "urlPath": "/files",
                  "headers": {
                          "Content-Type": { "contains": "multipart/form-data"},
                          "Source": { "matches": "POC(.+)"}
                  },
                  "multipartPatterns": [
                          {
                                  "headers": {
                                          "Content-Disposition": {
                                                  "contains": "name=\"typeOfFile\""
                                          }
                                  },
                                  "bodyPatterns": [ {
                                          "matches": "PDF"
                                  } ]
                          },
                          {
                                  "headers": {
                                          "Content-Disposition": {
                                                  "contains": "name=\"fileMetadataName\""
                                          }
                                  },
                                  "bodyPatterns": [ {
                                          "matches": "permissions,owner"
                                  } ]
                          }
                  ]
          },
          "response": {
                  "status": 201,
                  "jsonBody": {
                          "DocumentId": "123456789-123456789"
                  }
          }
  }
  </code></pre>
  
  <p>And here is an extract of the YAML that describes the multipart input:</p>
  
  <pre><code>paths:
    '/files':
      put:
        tags:
          - ProofOfConcept
        summary: Upload a file in the files repository
        description: Do the job
        operationId: putFile
        consumes:
          - multipart/form-data
        produces:
          - application/json
        parameters:
          - name: Source
            description: ID of the sender
            in: header
            type: string
            required: true
          - name: theFile
            description: The file to be uploaded
            in: formData
            required: true
            type: file
          - name: typeOfFile
            description: 'File type: PDF, JPG...'
            in: formData
            required: true
            type: string
          - name: fileMetadataName
            description: 'Metadata name. Possible values are: permissions, owner, group, creationDate, appGeneratedId (format: &lt;app-name&gt;;&lt;id&gt;)'
            in: formData
            type: array
            items:
              type: string
          - name: fileMetadataValue
            description: Value associated to the corresponding metadata name
            in: formData
            type: array
            items:
              type: string
        responses:
          '201':
            description: Created
            schema:
              $ref: '#/definitions/DocumentId'
  </code></pre>
  
  <p>I expect to be able to match for fileMetadataName, for example, all permutations of :</p>
  
  <pre><code>permissions, owner, group, creationDate, appGeneratedId
  </code></pre>
  
  <p>And in the case of fileMetadataValue, I expect to be able to match regex values for all permutations (e.g. ([0-9]{3,3}) for permissions).</p>