1 year ago

#361824

test-img

Stefano L

Pact Broker UI not visualizing usage of matchingRules and generators

When my PACT contains type matchers only instead of matching concrete values of Strings for example, my PACT Broker UI does not visualize that and thus, raising the impression for the provider that I do expect concrete values from the provider:

This is a part of my PACT:

"response": {
        "body": {
          "content": {
            "description": "Example description",
            "expensive": false,
            "goodRated": false,
            "price": 100,
            "productId": "string",
            "rating": 100,
            "title": "string"
          },
          "contentType": "application/json; charset=UTF-8",
          "encoded": false
        },
        "generators": {
          "body": {
            "$.price": {
              "max": 2147483647,
              "min": 0,
              "type": "RandomInt"
            },
            "$.productId": {
              "size": 20,
              "type": "RandomString"
            },
            "$.rating": {
              "max": 2147483647,
              "min": 0,
              "type": "RandomInt"
            },
            "$.title": {
              "size": 20,
              "type": "RandomString"
            }
          }
        },
        "headers": {
          "Content-Type": [
            "application/json; charset=UTF-8"
          ]
        },
        "matchingRules": {
          "body": {
            "$.description": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type"
                }
              ]
            },
            "$.price": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "number"
                }
              ]
            },
            "$.productId": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type"
                }
              ]
            },
            "$.rating": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "number"
                }
              ]
            },
            "$.title": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type"
                }
              ]
            }
          }

And this is how my broker shows it:

enter image description here

Other than the values shown, like 100 for price and rating or "string" for title and "Example description" for description, I do not find any hint that none of these values are exact matches but all type matches only. Do I not find it or something? I suppose this is a lack of feature of the UI?

pact

pact-broker

0 Answers

Your Answer

Accepted video resources