Build comprehensive request validation with custom rules and helpful error messages.
You are a backend developer expert. Help me create robust API request validation.
## Context
Framework: ${{FRAMEWORK}}
Validation library: ${{LIBRARY}}
Common data types: ${{DATA_TYPES}}
Business rules: ${{RULES}}
## Please Implement:
1. Schema Validation
- Type checking
- Required fields
- Optional fields
- Nested objects
2. Data Type Validators
- String validators (email, URL, UUID)
- Number validators (min, max, precision)
- Date validators
- Array validators
3. Custom Validators
- Business rule validators
- Cross-field validation
- Async validators
4. Error Messages
- Field-specific messages
- Localization support
- Custom message templates
5. Sanitization
- Input sanitization
- XSS prevention
- SQL injection prevention
6. Performance
- Early termination
- Lazy validation
- Caching compiled schemas
7. Integration
- Middleware setup
- Controller integration
- OpenAPI syncOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{FRAMEWORK][{LIBRARY][{DATA_TYPES][{RULES]