Skip to content

Conversation

@Sam-61s
Copy link
Contributor

@Sam-61s Sam-61s commented Jan 16, 2026

Fixes contains handling when minContains is set to 0.

Per JSON Schema Validation 2020-12 6.4.5, minContains: 0 must always pass
validation while still enforcing maxContains. This change removes an
incorrect early return and preserves evaluated item annotations.

Spec reference:
https://json-schema.org/draft/2020-12/json-schema-validation.html#name-mincontains

All JSON Schema Test Suite tests pass.

@jdesrosiers
Copy link
Collaborator

This is the kind of thing that should start with an issue and discussion first. I'm pretty confident that the test suite covers all the edge cases, so I'm quite sure this works as intended. You'll need to come up with an example schema/data that doesn't work properly. Show the actual results and the expected results.

I'm going to close this for now. If we determine it's needed, you can reopen it.

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.

2 participants