Skip to content

fix: use the correct name of enum, if the field name and the enum name are different (yup). #1038

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mindmind
Copy link

hey, just check updates in tests/yup.spec.ts to figure out the problem.

If the field name and the enum name are different (e.g. customPageName and PageName), then plugin provides incorrect enum name for the default value in the scope of yup. It just does PascalCase of the field name, but doesn't use the exact enum name.

I checked implementations for zod and myzod and they use the type name, not the field name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant