validate
opentp validate
Section titled “opentp validate”Validates all events in your tracking plan against the configuration.
opentp validate [options]Options
Section titled “Options”| Option | Description |
|---|---|
--root <path> | Project root directory |
--verbose | Show detailed output |
--external-rules <path> | Load custom validation rules |
--external-transforms <path> | Load custom transforms |
Examples
Section titled “Examples”Basic validation
Section titled “Basic validation”opentp validateOutput:
✓ All events are valid count=42With custom project root
Section titled “With custom project root”opentp validate --root ./my-tracking-planWith verbose output
Section titled “With verbose output”opentp validate --verboseShows detailed information about each validated event.
With custom rules
Section titled “With custom rules”opentp validate --external-rules ./my-rulesLoads additional validation rules from the specified directory.
Validation Checks
Section titled “Validation Checks”The validator performs these checks:
- Schema validation — event files match JSON schema
- Key validation — event keys match the configured pattern
- Taxonomy validation — required taxonomy fields are present
- Dictionary validation — values match referenced dictionaries
- Rule validation — fields pass all configured rules
- Path validation — file paths match configured patterns
Error Output
Section titled “Error Output”When validation fails, errors are displayed with:
- File path
- Error type
- Error message
- Suggested fix (when available)
✗ events/auth/login.yaml Key mismatch: expected "auth::login", got "auth::login_click"
✗ events/dashboard/view.yaml Missing required field: taxonomy.action
Found 2 errors in 42 events