Skip to content

Tests for uniqueItems only test arrays with two items #524

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

Closed
DrGFreeman opened this issue Nov 3, 2021 · 1 comment · Fixed by #525
Closed

Tests for uniqueItems only test arrays with two items #524

DrGFreeman opened this issue Nov 3, 2021 · 1 comment · Fixed by #525

Comments

@DrGFreeman
Copy link
Contributor

The tests for non-unique items with uniqueItems enabled only test arrays with two items, e.g.:

{
"description": "non-unique array of arrays is invalid",
"data": [["foo"], ["foo"]],
"valid": false
},

In some validation library implementations, having unique first two first items can result in the validation to pass (e.g.: python-jsonschema/jsonschema#866). In this case, addition of a third item in the array would allow testing that the validation is performed on all elements of the array:

{
    "description": "non-unique array of arrays is invalid",
    "data": [["foo"], ["bar"], ["foo"]],
    "valid": false
},

Also, there is no test case for non-unique string items (only numeric and array items).

@DrGFreeman
Copy link
Contributor Author

I will submit a PR to add / modify tests for this issue shortly.

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

Successfully merging a pull request may close this issue.

1 participant