Overview
Validation commands provide functionality for:- Validating data structure and format
- Checking data types and values
- Verifying data completeness
- Validating data against schemas
- Ensuring data quality standards
Common Use Cases
- Data Quality Assurance: Ensure data meets quality standards
- Schema Validation: Validate data against expected schemas
- Type Checking: Verify data types match expectations
- Completeness Checks: Ensure required fields are present
- Error Prevention: Catch data issues before processing
Command Parameters
Validation commands typically support the following parameters:| Parameter | Type | Description | Required |
|---|---|---|---|
| data | object | Data to validate | Yes |
| schema | object | Validation schema | Yes |
| rules | array | Validation rules to apply | Yes |
| onError | string | Action to take on validation error | No |
Validation Types
Structure Validation
Validate data structure:Type Validation
Validate data types:Value Validation
Validate data values:Validation Rules
Common validation rules include:- Required Fields: Ensure required fields are present
- Type Checking: Verify data types match expectations
- Range Validation: Check numeric values are within ranges
- Format Validation: Validate string formats (email, URL, etc.)
- Length Validation: Check string lengths
Best Practices
- Validate Early: Validate data as early as possible in workflows
- Clear Error Messages: Provide clear, actionable error messages
- Handle Validation Errors: Implement proper error handling
- Use Schemas: Define validation schemas for consistency
- Test Validation: Test validation rules with various data scenarios
Related Commands
- Parse Commands - Parse data before validation
- HTTP Commands - Validate HTTP responses
- Execution Flow Commands - Handle validation errors