-
Notifications
You must be signed in to change notification settings - Fork 12
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
chore: simplify tracing of known type and required in nested rules #179
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files
|
@kklash could u review? i can't seem to request a review via the UI |
@ChALkeR do we need to rebase + edit this test? https://github.com/ExodusMovement/schemasafe/pull/177/files#diff-6208744208cefe72d8f280336376b2302056b2d145203d67bd97c35f86ac9846R18 |
75dd90b
to
c87a7cc
Compare
d997a64
to
8057cf2
Compare
@mvayngrib Done! |
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.
utACK
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.
utACK
take with a grain of salt, cause i'm a bit out of my depth and can't invest the time to understand this deeply atm 😓
The base branch was changed.
This apparently now needs a rebase and re-reviews. |
E.g. in allOf/oneOf, we just rely on the checks in parent rule, but only for type/required checks. In the following schema, the nested allOf will just check for `{ required: ['yyy'] }`: ``` { type: 'object', required: ['xxx','zzz'], allOf: [{ type: 'object', required: ['xxx', 'yyy'] }] } ``` Properties/items can't be inherited as they affect evaluation checks, which should be isolated from the parent.
8057cf2
to
af30bc0
Compare
Rebased |
@ChALkeR maybe we want to disable that requirement? |
After #177 and #178.
E.g. in allOf/oneOf, we just rely on the checks in parent rule, but only for type/required checks.
In the following schema, the nested allOf will just check for
{ required: ['yyy'] }
:Properties/items can't be inherited as they affect evaluation checks, which should be isolated from the parent.
The new
if (definitelyType(...typearr)) return null
line which replaced manual check in history is now able to catch more cases, which can be seen in generated code diffs, when we got type information from a ref (compare after #178 is landed, or just review d997a64).This also will make #176 (nested discriminators) stop complaining with just a single
type: 'object'
check on the top level.