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

Error in CustomValidationPipe #5

Open
hubts opened this issue Jul 9, 2024 · 0 comments
Open

Error in CustomValidationPipe #5

hubts opened this issue Jul 9, 2024 · 0 comments

Comments

@hubts
Copy link
Owner

hubts commented Jul 9, 2024

📸 What is this issue?

What is an issue? Please explain with some screenshots.

The parameters using @Query decorator have the type as String in default. We tried to transform the parameters as Number, such like skip or take. However, there is transform: true in CustomValidationPipe, no transform was applied.

After debugging, we found CustomValidationPipe returns the original value after plainToClass and validate processes. The plainToClass makes the original value to be transformed, so the transformed values(parameters) must be returned as transform result.

image

The code image shows a result that should have changed. In previous, value is returned instead of transformed (object).

✨ Expected Results

What result do you expect?

To use @Transform decorator in DTO, CustomValidationPipe should be changed to return the transformed object. For the moment, transform returns the original value.

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

1 participant