Hey there, I'm getting this error when attempting ...
# pact-net
f
Hey there, I'm getting this error when attempting to verify a previously published contract:
Copy code
[INFO][pact_verifier::pact_broker] Fetching path '/pacts/provider/publish-service/consumer/alm-app/pact-version/6bc3dee5de1ea718ef23d4dab94fa32536ecf014/metadata/c1tdW2N2XT0xMTI2MiZwPXRydWU' from pact broker
[DEBUG][hyper::client::pool] reuse idle connection for ("https", <http://outsystems.pactflow.io|outsystems.pactflow.io>)
[DEBUG][reqwest::async_impl::client] response '200 OK' for <https://outsystems.pactflow.io/pacts/provider/publish-service/consumer/alm-app/pact-version/6bc3dee5de1ea718ef23d4dab94fa32536ecf014/metadata/c1tdW2N2XT0xMTI2MiZwPXRydWU>
[ERROR][pact_verifier] Failed to load pact - Failed to load pact from '<https://outsystems.pactflow.io/>' - ContentError("Expected a \".\" or \"[\" instead of \"r\" in path expression \"$results[*].deploymentOperations[*].applicationKey\" at index 1")
[WARN][pact_matching::metrics]
The part i'm not understanding is why it's failing on parsing the matcher locator:
Copy code
"matchingRules": {
          "body": {
            "$results[*].deploymentOperations[*].applicationKey": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "regex",
                  "regex": "^$|[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}$"
                }
              ]
            },
d
Hey) Was the pact successfully fetched before verification? Judging by the logs it failed right there
f
It fails when it gets the contract, and then tries to parse it
d
Does it mean that the contract was eventually fetched after retry or so? Otherwise I don't understand what it tries to parse
f
It fetched the contract, but when it tries to parse the json, it fails on that matcher
It got a 200 okay in the response to getting the contract
d
ok
m
@uglyog any ideas? Looks like maybe a badly generated contract?
u
$results[*].deploymentOperations[*].applicationKey
is not correct. It is missing the period after the dollar (as the error is saying). I.e
$.results[*].deploymentOperations[*].applicationKey
t
What generated the contract?
f
i see thanks
it was generated via a internal low code tool
👀 1
i will report this error to them, so they can fix the contract generation
again, thanks for the help in diagnosing this issue
t
Interesting. What's the use case for an internal tool for generating pact files?
f
we have a lot of low code applications that are the consumers for services that are high code. Thus, since they're the consumers, they need a way to create the consumer contract
for example a low code app would call a rest api to get some kind of result from a service
t
Interesting. Well, as long as whatever generates the pact file is ensuring that the consumer sends that request and understands things that match that response you should be fine