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

uniqueItemsProperties - combined unique properties #386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

atng
Copy link

@atng atng commented Apr 16, 2023

PR in response to the feature request in issue 107.

This PR impliments the suggestion by @epoberezkin by changing the keyword implementation of uniqueItemsProperties.

It extends the uniqueItemsProperties to accepts arrays of strings in addition to strings as items in the array.

You can extend this keyword to accept arrays of strings in addition to strings as items in the array to pass to the keyword.

e.g.

With the schema:

{"uniqueItemProperties": [["email", "username"]]}
[{"email": "one@email.com", username: "one"}, {"email": "two@email.com", username: "two"}]

Would pass.

[{"email": "one@email.com", username: "one"}, {"email": "one@email.com", username: "two"}]

Would pass.

[{"email": "one@email.com", username: "one"}, {"email": "two@email.com", username: "one"}]

Would also pass.

[{"email": "one@email.com", username: "one"}, {"email": "one@email.com", username: "one"}]

But one one would fail since both the username and email matches..

@atng
Copy link
Author

atng commented Apr 16, 2023

@epoberezkin

@atng atng reopened this Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant