Skip to content

Conversation

@JDepooter
Copy link
Contributor

It is tempting to forgo evaluation of the 'contains' schema when minContains = 0. However, when an unevaluatedItems schema is present, the contains schema must still be evaluated as it will affect the results of the unevaluatedItems schema.

It is my understanding that the interaction between contains and unevaluatedItems is not defined prior to the draft2020-12 specification, so I have not added the test for any earlier versions.

It is tempting to forgo evaluation of the 'contains' schema when `minContains = 0`. However, when an `unevaluatedItems` schema is present, the `contains` schema must still be evaluated as it will affect the results of the `unevaluatedItems` schema.
@JDepooter JDepooter requested a review from a team as a code owner March 18, 2025 06:45
@JDepooter
Copy link
Contributor Author

@gregsdennis is there anything that needs to be done for this to be merged?

@gregsdennis
Copy link
Member

I was waiting for someone else to review, but I don't see a problem with this.

@gregsdennis gregsdennis merged commit 15e4505 into json-schema-org:main Jul 19, 2025
3 checks passed
@jviotti
Copy link
Member

jviotti commented Jul 21, 2025

Ah, looks like this indeed hits https://github.com/sourcemeta/blaze. Thanks for reporting it!

jviotti added a commit to sourcemeta/blaze that referenced this pull request Jul 21, 2025
We incorrectly compile away `contains` when `minContains: 0` even if we
do actually need to track evaluation for other reasons (i.e.
`unevaluatedItems`).

See: json-schema-org/JSON-Schema-Test-Suite#765
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit to sourcemeta/blaze that referenced this pull request Jul 21, 2025
We incorrectly compile away `contains` when `minContains: 0` even if we
do actually need to track evaluation for other reasons (i.e.
`unevaluatedItems`).

See: json-schema-org/JSON-Schema-Test-Suite#765
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@JDepooter JDepooter deleted the unevaluated_items_with_mincontains_0 branch July 24, 2025 21:06
syedazeez337 pushed a commit to syedazeez337/blaze-profiling-lab that referenced this pull request Oct 27, 2025
We incorrectly compile away `contains` when `minContains: 0` even if we
do actually need to track evaluation for other reasons (i.e.
`unevaluatedItems`).

See: json-schema-org/JSON-Schema-Test-Suite#765
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
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 this pull request may close these issues.

3 participants