Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PactSpec v3 not supported? #61

Closed
lt-mayonesa opened this issue Nov 13, 2020 · 3 comments
Closed

PactSpec v3 not supported? #61

lt-mayonesa opened this issue Nov 13, 2020 · 3 comments

Comments

@lt-mayonesa
Copy link

lt-mayonesa commented Nov 13, 2020

Hi, i'm having the following issue ¿what am i missing?

WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported matchers [{"match"=>"number"}] for path $['amount']
WARN: Ignoring unsupported combine AND for path $['amount']
WARN: Ignoring unsupported matchers [{"match"=>"timestamp", "timestamp"=>"yyyy-MM-dd'T'HH:mm:ss"}] for path $['expires_at']
WARN: Ignoring unsupported combine AND for path $['expires_at']

full_log.txt

Command:

docker run --rm --net host \
  -e PACT_BROKER_BASE_URL=https://pactbroker.custom.domain.com/ \
  -e PACT_BROKER_USERNAME \
  -e PACT_BROKER_PASSWORD \
  -e PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=false \
  pactfoundation/pact-cli:0.24.0.0 verify \
  --provider ms-virtual-account \
  --provider-base-url http://localhost:59000 \
  --provider-app-version "$1" \
  --no-enable-pending \
  --wait 10 \
  --provider-version-tag local-test \
  --consumer-version-selector '{"tag":"local","latest":true,"fallbackTag":"feats"}' \
  --consumer-version-selector '{"tag":"dev","latest":true,"fallbackTag":"prod"}'

This is my pact (part of):

{
  "interactions": [
    {
      "_id": "1d4705eb3dfafb618d9a9172bf701406e4e736cf",
      "description": "a request to reserve amount",
      "request": {
        "method": "POST",
        "path": "/movements",
        "headers": {
          "Content-Type": "application/json"
        },
        "body": {
          "amount": 100.5,
          "intention_id": "4",
          "type": "reserve"
        }
      },
      "response": {
        "status": 201,
        "headers": {
          "Content-Type": "application/json; charset=UTF-8"
        },
        "body": {
          "amount": 100.5,
          "expires_at": "2020-11-12T14:15:38",
          "id": "5",
          "status": "CREATED"
        },
        "matchingRules": {
          "body": {
            "$.id": {
              "matchers": [
                {
                  "match": "type"
                }
              ],
              "combine": "AND"
            },
            "$.amount": {
              "matchers": [
                {
                  "match": "number"
                }
              ],
              "combine": "AND"
            },
            "$.expires_at": {
              "matchers": [
                {
                  "match": "date",
                  "date": "yyyy-MM-dd'T'HH:mm:ss"
                }
              ],
              "combine": "AND"
            }
          },
          "header": {
            "Content-Type": {
              "matchers": [
                {
                  "match": "regex",
                  "regex": "application/json(;\\s?charset=[\\w\\-]+)?"
                }
              ],
              "combine": "AND"
            }
          }
        }
      },
      "providerStates": [
        {
          "name": "account has available balance"
        }
      ]
    }
  ],
  "metadata": {
    "pactSpecification": {
      "version": "3.0.0"
    },
    "pact-jvm": {
      "version": "4.1.7"
    }
  }
}
@bethesque
Copy link
Member

v3 is not supported yet, sorry.

@lt-mayonesa
Copy link
Author

Which is the latest supported? I'm having a similar issue with a v2 pact.

WARN: Ignoring unsupported matching rules {"match"=>"date", "date"=>"yyyy-MM-dd'T'HH:mm:ss"} for path $['body']['expires_at']

pd: there's a section in the README with something about v3. That's a bit confusing.

Thanks in advance!

@YOU54F
Copy link
Member

YOU54F commented Aug 13, 2024

V3 is only partially supported, see tracking issue pact-foundation/pact-ruby#318 for more detail.

Pact-Ruby can write 3.0.0 HTTP pacts but in an incorrect format, with V2 matching rules.

Closing as tracking in the v3 meta issue

@YOU54F YOU54F closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants