Skip to content

Commit 4a9b8e8

Browse files
committed
Clarify that unevaluatedItems depends on contains
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent e90e1ec commit 4a9b8e8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

content/2020-12/unevaluated/unevaluatedItems.markdown

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ keyword is a generalisation of the [`items`]({{< ref "2020-12/applicator/items"
3232
>}}) keyword that considers related keywords even when they are not direct
3333
siblings of this keyword. More specifically, this keyword is affected by
3434
occurences of [`prefixItems`]({{< ref "2020-12/applicator/prefixitems" >}}),
35-
[`items`]({{< ref "2020-12/applicator/items" >}}), and [`unevaluatedItems`]({{<
36-
ref "2020-12/unevaluated/unevaluateditems"
35+
[`items`]({{< ref "2020-12/applicator/items" >}}), [`contains`]({{< ref
36+
"2020-12/applicator/contains" >}}), and [`unevaluatedItems`]({{< ref
37+
"2020-12/unevaluated/unevaluateditems"
3738
>}}) itself, as long as the evaluate path that led to
3839
[`unevaluatedItems`]({{< ref "2020-12/unevaluated/unevaluateditems"
3940
>}}) is a _prefix_ of the evaluate path of the others.
@@ -45,13 +46,15 @@ other keyword from every other vocabulary.
4546

4647
There are two common use cases for this keyword, both for reducing duplication:
4748
(1) Elegantly describing additional array items while declaring the
48-
[`prefixItems`]({{< ref "2020-12/applicator/prefixitems" >}}) keyword behind
49+
[`prefixItems`]({{< ref "2020-12/applicator/prefixitems" >}}) or
50+
[`contains`]({{< ref "2020-12/applicator/contains" >}}) keywords behind
4951
conditional logic without duplicating the [`items`]({{< ref
5052
"2020-12/applicator/items"
5153
>}}) keyword in every possible branch. (2) Re-using
5254
helpers that consist of the [`prefixItems`]({{< ref
53-
"2020-12/applicator/prefixitems" >}}) or [`items`]({{< ref
54-
"2020-12/applicator/items" >}}) keywords, while specialising the helpers as
55+
"2020-12/applicator/prefixitems" >}}), [`items`]({{< ref
56+
"2020-12/applicator/items" >}}), or [`contains`]({{< ref
57+
"2020-12/applicator/contains" >}}) keywords, while specialising the helpers as
5558
needed in specific locations without having to inline the entire contents of
5659
the helper.
5760

0 commit comments

Comments
 (0)