From 1085b27490c1af645edcac1c4093b01f563ddb7a Mon Sep 17 00:00:00 2001 From: DrGFreeman Date: Wed, 3 Nov 2021 20:19:56 -0400 Subject: [PATCH] Ensure all items of array are checked for uniqueness Fix bug where the function would return (True) early if the first two items of the array are unique, preventing verification of other array items. --- jsonschema/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py index e5051ec10..0cfb84fdf 100644 --- a/jsonschema/_utils.py +++ b/jsonschema/_utils.py @@ -188,7 +188,8 @@ def uniq(container): sliced = itertools.islice(sort, 1, None) for i, j in zip(sort, sliced): - return not _sequence_equal(i, j) + if _sequence_equal(i, j): + return False except (NotImplementedError, TypeError): seen = []