-
Notifications
You must be signed in to change notification settings - Fork 156
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
fix: ignore zod errors for json schema validations #5461
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success2084 tests passing in 924 suites. Report generated by 🧪jest coverage report action from 130aebc |
@@ -56,7 +56,7 @@ export async function unifiedConfigurationParserFactory( | |||
errorSet.add(key) | |||
return true | |||
}) | |||
if (zodParse.state !== 'ok' || errors.length > 0) { | |||
if (jsonSchemaParse.state !== 'ok') { |
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.
shouldn't this just look at the length of errors
? In this case if zodParse
had errors, but jsonSchemaParse
didn't it wouldn't return the error state?
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.
We technically should not be using zodParse for json schema. I would like to remove it from this file, but I feel I may be missing some edge cases and reasoning behind why it's still used here.
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.
Seems simple enough, but calling out not having tests (I realize it's draft).
WHY are these changes introduced?
JSON schema extension contracts validations were being ignored. Custom CLI validations were still being used to validate json-schemas from the server. As we move to the CLI being a dumb client, respecting the server schema file will help make moving to the new world faster
WHAT is this pull request doing?
Switching from zod validations to json-schema validations for extensions with json-schemas
How to test your changes?
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist