Skip to content
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(class-validator): return instance unless rawValues is set #617

Merged
merged 1 commit into from
Aug 17, 2023
Merged

fix(class-validator): return instance unless rawValues is set #617

merged 1 commit into from
Aug 17, 2023

Conversation

perebusquets
Copy link
Contributor

@perebusquets perebusquets commented Aug 17, 2023

PR regarding this issue: #616


const result = await classValidatorResolver(SchemaTest, {
transformer: {
excludeExtraneousValues: true,
Copy link
Member

Choose a reason for hiding this comment

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

I don't find any documentation about excludeExtraneousValues and extraneousField. Do you have a link that explains these options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Here it's explained: https://github.com/typestack/class-transformer#enforcing-type-safe-instance

This was just to make sure that the class-transformer acted correctly and didn't send extra fields, but we could use any other use case for the test if necessary (like the example in the codesandbox linked in the issue)

Copy link
Member

@jorisre jorisre left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@jorisre jorisre merged commit 4882173 into react-hook-form:master Aug 17, 2023
3 checks passed
@perebusquets perebusquets deleted the fix-class-validator-raw-values branch August 17, 2023 19:46
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants