feat: support unevaluatedProperties in Draft 2019-09 - #931
Open
tomatotomata wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a focused proof of concept for
unevaluatedPropertiesin Draft 2019-09, following the scope discussed in #907.The implementation derives evaluated property names from
properties,patternProperties, and directallOfbranches. That covers the motivating composition while keeping the first patch small. WhenunevaluatedPropertiesis a schema, each remaining property is validated against it. When it isfalse, the validator reports the property with a dedicated constraint error.The validator does not yet carry annotations across every applicator, so this intentionally does not claim complete Draft 2019-09 semantics for
anyOf,oneOf, conditionals, or referenced schemas. I would treat this as a proof of concept for the project to shape further.Tests
php -d extension=mbstring -d extension=openssl vendor/bin/phpunit --filter UnevaluatedPropertiesTest --testdoxpasses locally (2 assertions-backed cases, 2 expected skips for the assoc/type-cast variants).git diff --checkpasses.This patch was prepared with AI assistance and then reviewed and tested in this checkout. The repository's contribution notice asks contributors to have authored 100% of the content, so please let me know if the project needs a different treatment of that requirement before considering the patch.
Updates #907