-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
EachKeyLike matcher generates wrong rules and wrong example #285
Comments
I also attempted to change the type on the pact-go library ( // Object where the key itself is ignored, but the value template must match.
//
// key - Example key to use (which will be ignored)
// template - Example value template to base the comparison on
func EachKeyLike(key string, template interface{}) Matcher {
return eachKeyLike{
Specification: models.V3,
Type: "eachValue",
Contents: template,
}
} This is the rule generated
However the test also failed, albeit with a different error:
The example was also wrong:
|
I think it's a matter of changing the value of this attribute on the matcher to If you wanted to attempt a PR and check if it resolves, that would be super helpful! |
Thanks @mefellows I'll try your suggested fix and create a PR for it. |
Thank you! |
👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-1056). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. |
Waiting on upstream clarification: pact-foundation/pact-reference#299 |
Software versions
go version go1.18.3 darwin/arm64
go env
Expected behaviour
Given a request body like:
I expect a contract with the following rules for the request body to match (all else being OK):
Actual behaviour
Given the previous request body and contract rules I get the following error:
Looking at the log I see the pact expected request is also wrong:
Steps to reproduce
You can run this test to reproduce the issue:
Relevent log files
eachkeylike_issue.log
The text was updated successfully, but these errors were encountered: