Mattersight / pact-net-messages

Pact.Net v3 implementation of message only for services that communicate via event streams and message queues
MIT License
10 stars 5 forks source link

Question: How do I get "matchingRules" in a consumer Pact file? #5

Open KarinBerg opened 5 years ago

KarinBerg commented 5 years ago

I wrote a test to generate a consumer Pact file. Unfortunately the "matchingRules" are missing and I have no idea how to integrate them? Could someone give me a hint?

Here an example of what I miss:

...
  "messages": {
      "description": "ThingUpdatedEvent",
      "metaData": {
        "type": "ThinkUpdated"
      },
      "contents": {
          "id": "some id",
          "updatedAt": "20190114T12111869Z",
      },
      "providerStates": [
        {
          "name": "a thing was updated"
        }
      ],
      "matchingRules": {
          "body": {
            "$.id": {
              "matchers": [
                {
                   "match": "type"
                }
              ],
             "combine": "AND"
           },
           "$.updatedAt": {
              "matchers": [
              {
                  "match": "regex",
                  "regex": "\\d{8}T\\d{6,9}Z"
              }
            ],
            "combine": "AND"
          }
        }
      }
...