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

Incorrect header matching rules key in v2 pact files #449

Open
mefellows opened this issue Jun 21, 2024 · 2 comments
Open

Incorrect header matching rules key in v2 pact files #449

mefellows opened this issue Jun 21, 2024 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@mefellows
Copy link
Member

mefellows commented Jun 21, 2024

Sample (modified) but discovered by the V2 specs from the terraform client

{
  "consumer": {
    "name": "terraform-client"
  },
  "interactions": [
    {
      "description": "a request to create a system account",
      "request": {
        "method": "GET",
        "path": "/foo"
      },
      "response": {
        "matchingRules": {
          "$.header.Example": {
            "match": "type"
          }
        },
        "headers": {
          "Example": "value"
        },
        "status": 200
      }
    }
 ],
  "metadata": {
    "pactRust": {
      "ffi": "0.4.16",
      "mockserver": "1.2.5",
      "models": "1.1.19"
    },
    "pactSpecification": {
      "version": "2.0.0"
    }
  },
  "provider": {
    "name": "pactflow-application-saas"
  }
}

The field should be $.headers.<key> not $.header.<key> as per https://github.com/pact-foundation/pact-specification/blob/version-2/testcases/response/headers/matches%20with%20regex.json#L10.

@mefellows mefellows added the bug Indicates an unexpected problem or unintended behavior label Jun 21, 2024
@Saup21
Copy link

Saup21 commented Jun 21, 2024

@rholshausen
Copy link
Contributor

This has been around for a very long time. It was fixed in Pact-JVM in 2019 pact-foundation/pact-jvm#882

rholshausen added a commit that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants