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

Give an option to combine class-validator's decorators with class-transformer's "excludeExtraneousValues" ? #45

Open
pauloendoh opened this issue Jan 26, 2023 · 1 comment

Comments

@pauloendoh
Copy link

pauloendoh commented Jan 26, 2023

Since this package uses both class-validator and class-transformer, and many users complain on applying @expose() on all fields in order to remove extraneous values, wouldn't it be possible to give an option to levarage the validation decorators?

Something like "excludeUnvalidatedFields"?

Or, perhaps, we could have something like @IsStringExpose(), that wraps both @IsString() and @expose() ? I created this Gist as reference: https://gist.github.com/pauloendoh/f7d3194bae2ff121e78ce45589bd4ab2

@MichalLytek
Copy link
Owner

I think not. This library is just a simple wrapper around those two, but adding additional decorators that changes behavior is out of scope I think.

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

No branches or pull requests

2 participants