About Pipes
Validation and transformation pipes
Browse the snippets below to find the pipes implementation you need for your NestJS project.
All Pipes Snippets
Class Validator Pipe
Validation using class-validator
- Detailed error formatting
- Nested validation support
- Whitelist enabled
Zod Validation Pipe
Validation using Zod schemas
- @ZodValidate decorator
- Detailed Zod errors
- Per-route schemas
Parse UUID Pipe
UUID parsing and validation
- UUID version validation
- Optional handling
- Lower case normalization
File Validation Pipe
File upload validation
- Size limits
- MIME type checking
- Extension validation
Trim Strings Pipe
Trim whitespace from strings
- Recursive trimming
- Include/exclude fields
- Empty to null option
How to Use
Install any snippet using the Hanma CLI:
npx hanma add --framework nest
For example, to install the first snippet:
npx hanma add class-validator-pipe --framework nest