-
Notifications
You must be signed in to change notification settings - Fork 2
fix: enhance unevaluatedProperties handling for composite rules #28
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
Conversation
| gen.if(_`${N.isAllOfVariant} === 0`, staticCheck) | ||
| } else { | ||
| staticCheck() | ||
| if (!it.compositeRule || cxt.schema !== undefined) { |
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.
In composite rules run static check only when schema explicitly provides unevaluatedProperties
| ) | ||
|
|
||
| if (isForced && it.errorPath.emptyStr()) { | ||
| if (isForced && it.errorPath.emptyStr() && !it.compositeRule) { |
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.
Skip forced static check under composite rules (anyOf/oneOf)
|
tested in redocly-cli and monorepo. all tests pass |
RomanHotsiy
left a comment
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.
👍 LGTM
|
Does original AJV has the same problem if the Did you also run ajv tests? |
cb9778c to
00c32b6
Compare




What issue does this pull request resolve?
fix for: redocly cli #1737
What changes did you make?
Changes in unevaluatedProperties.ts to skip the forced static check in anyOf/oneOf. This removes false unevaluatedProperties errors and allows schema to pass validly with the current example:
Is there anything that requires more attention while reviewing?