NestJS · Junior · Question 33 of 75
What does transform: true in ValidationPipe give you?
- 1DTO field names are converted to snake_case
- ✓Correct answer: Payloads are turned into instances of the DTO classes, and primitive params can be converted to the declared types
- 3Responses are compressed
Explanation
Without it, the handler gets plain objects and strings, even if the parameter is typed as a class or number.