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

Adding conditional based matchers in LambdaDslObject #1856

Open
durgamanasa opened this issue Mar 5, 2025 · 0 comments
Open

Adding conditional based matchers in LambdaDslObject #1856

durgamanasa opened this issue Mar 5, 2025 · 0 comments

Comments

@durgamanasa
Copy link

Hello team,

We are trying to write Contract test for Async messages using Pact using Java.

We have the below object

"user": {
"id": "user1",
"email": "[email protected]"
}

We want to add the rule like when the "id" is "user1" then "email" field is mandatory. And if "id" is anything else apart from "user1" then "email" field is not mandatory. How can we achieve this using "LambdaDslObject"

Here is sample LambdaDslObject that we are setting
data.object(
USER,
user -> user.stringValue(ID, "user1"));

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

1 participant