Ignore $ref siblings in supported JSON Schema drafts - #116
Open
Kaiserunix wants to merge 1 commit 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.
Fixes #97.
Generating values for a non-recursive schema could fail with an unresolvable JSON pointer when a
$refhad a siblingitemsschema. Resolve the referenced schema without merging sibling keywords, matching the supported Draft 4, 6, and 7 semantics. This also avoids treating conflicting sibling constraints as an unsatisfiable schema.Regression tests cover both
definitionsand$defslocations across all three supported drafts, plus conflicting sibling constraints. The existing Draft 7 corpus case now declares its draft explicitly so its validation uses Draft 7 instead of the dependency's default newer draft.Validation on Windows, CPython 3.12, with the repository's pinned test/check dependencies:
pytest -n 4 --durations=10 -k 'not test_can_generate_for_real_large_schema': 704 passed, 24 skipped, 52 xfailed, 2 xpassed; 100% coverage. These skips and expected-failure markers are existing suite policy, not added by this change.git diff --checkpassed._from_schema.py; the same command and environment against an independent checkout of the base commit produce the identical ten errors.The separately scheduled slow corpus job and other OS/Python combinations were not run locally. This patch was prepared with AI assistance and independently reviewed.