A typo in a theme.json key is silently ignored, which means a setting that does nothing looks exactly like a setting that works.
- name: Validate theme.json
run: |
npx ajv-cli validate
-s https://schemas.wp.org/wp/6.1/theme.json
-d theme.json --strict=false
for f in styles/*.json; do
npx ajv-cli validate -s ... -d "$f" --strict=false
done
The published schema is versioned by WordPress release, so pinning it to the minimum supported version catches a key that only exists in a later one. It is the cheapest possible check for a file that is otherwise verified by loading a page and looking at it, and it catches the class of error — a misspelled key — that a visual check cannot.