-
-
Notifications
You must be signed in to change notification settings - Fork 90
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(cli): fixes the issue that enhancer ignores zod schemas if it's explicitly configured in ZModel #1632
Conversation
…xplicitly configured in ZModel
WalkthroughWalkthroughThe changes made enhance the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- packages/schema/src/cli/plugin-runner.ts (1 hunks)
- packages/testtools/src/schema.ts (1 hunks)
- tests/regression/tests/issue-1562.test.ts (1 hunks)
Additional comments not posted (3)
tests/regression/tests/issue-1562.test.ts (1)
1-45
: LGTM! Ensure the schema is loaded correctly.The new regression test case for issue #1562 is well-structured and covers the necessary aspects to validate the fix. Ensure that the
loadSchema
function correctly loads the schema and that theenhance
plugin works as expected with thezod
plugin.To verify the correctness of the schema loading, you can run the test case and ensure it passes.
packages/testtools/src/schema.ts (1)
Line range hint
1-1
:
LGTM! Verify the function's correctness.The
loadSchema
function has been simplified by removing thepolicy
,modelMeta
, andzodSchemas
parameters from the destructured options object. Ensure that the function still operates correctly without these parameters.To verify the function's correctness, you can run the test cases that involve the
loadSchema
function and ensure they pass.packages/schema/src/cli/plugin-runner.ts (1)
186-194
: LGTM! Verify the schema loading logic.The
PluginRunner
class has been enhanced to ensure that Zod schemas are loaded appropriately based on the presence of validation rules. This improves the plugin's adaptability to different validation scenarios.To verify the correctness of the schema loading logic, you can run the test cases that involve the
PluginRunner
class and ensure they pass.
Fixes #1562