| name | validate |
| description | Validate .view.yml semantic layer files using airlayer. Use when the user creates or modifies view files and wants to check for errors. |
| allowed-tools | ["Bash","Read","Glob"] |
| argument-hint | |
airlayer Validate — Check Semantic Layer Files
Validate .view.yml files for correctness.
Prerequisites
which airlayer || cargo install --git https://github.com/oxy-hq/airlayer
Find and validate
- Locate the base directory containing
views/:
find . -name "*.view.yml" -not -path "*/node_modules/*" -not -path "*/cube/*" 2>/dev/null | head -10
- Run validation:
airlayer validate
$ARGUMENTS
What it checks
- All views have either
table or sql (not both, not neither)
- No duplicate view names
- Entity key references point to existing dimensions
- Dimension/measure types are valid
- Cross-entity references (
{{entity.field}}) resolve correctly
- Measure-to-measure references (
{{view.measure}}) resolve correctly
On error
Show the user the validation error and the relevant section of the .view.yml file. Suggest a fix.