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

Merged
merged 1 commit into from
Jun 7, 2025

Conversation

mindmind
Copy link
Contributor

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.

Copy link
Owner

@Code-Hex Code-Hex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mindmind Thank you so much!

@Code-Hex Code-Hex merged commit e25d913 into Code-Hex:main Jun 7, 2025
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.

2 participants