-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSON] Raise exceptions when "sibling" keywords are unhandled #1063
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
- Coverage 65.40% 64.16% -1.24%
==========================================
Files 63 63
Lines 4810 4842 +32
==========================================
- Hits 3146 3107 -39
- Misses 1664 1735 +71 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will wait on other merge
8c84aef
to
8487e8b
Compare
@riedgar-ms ready :) |
WIP BECAUSE THIS DEPENDS ON STILL-OPEN PR #1061
When an applicator has sibling keywords, JSON schema mandates that both sets of keywords are respected, e.g.
In this schema, "minimum" is a "sibling" to the "$ref", and we need to enforce BOTH the schema in the definition AND the "minimum" keyword.
There are some trivial examples of this general problem, and we can provide implementations for them (in this PR, I also include an implementation for combinations of the "type", "const", and "enum" keywords, which addresses the enum part of #1038). But when no implementation is provided, we need to raise an exception to prevent "type 1 errors" (the LLM is happy to generate an instance that might not validate against the full schema).
There are a number of tests in the
TestRefs
class that have to be xfailed due to this stricter behavior. In time, we can add more implementations that handle siblings, reducing the number of xfails.