Validation Guide¶
This guide helps you troubleshoot and fix validation errors in .readability.yml files.
Running Validation¶
CLI Validation¶
The quickest way to validate your config:
Success output:
Error output:
Configuration validation failed:
• thresholds.max_grade
got string, want number
Suggestion: Remove quotes around numeric values
See https://github.com/adaptive-enforcement-lab/readability/blob/main/do../index.md for configuration reference.
check-jsonschema¶
For more detailed validation output:
# Install check-jsonschema
pipx install check-jsonschema
# Validate config
check-jsonschema --schemafile docs/schemas/config.json .readability.yml
IDE Validation¶
Most IDEs show validation errors inline:
- Red squiggles: Mark invalid values
- Hover tooltip: Show error message
- Problems panel: List all errors
Common Errors¶
Type Errors¶
String Instead of Number¶
Error:
Cause: Numeric values wrapped in quotes.
Invalid:
Valid:
String Instead of Integer¶
Error:
Cause: Integer values wrapped in quotes.
Invalid:
Valid:
Wrong Type for Complex Values¶
Error:
Cause: Object field has a simple value instead of nested structure.
Invalid:
Valid:
Range Errors¶
Value Too High¶
Error:
Cause: Numeric value exceeds schema maximum.
Invalid:
Valid:
Value Too Low¶
Error:
Cause: Value below schema minimum.
Invalid:
Valid:
Disabling Checks
Some fields support negative values to disable checks:
- min_ease: -100 disables ease check
- min_admonitions: -1 disables admonition requirement
- max_dash_density: -1 disables dash check
Property Errors¶
Unknown Field¶
Error:
Cause: Field name doesn't exist in schema (typo or removed field).
Invalid:
thresholds:
max_grade: 12
max_smog: 18 # ❌ Field doesn't exist
max_syllables: 180 # ❌ Field doesn't exist
Valid:
Tip: Use IDE autocomplete (Ctrl+Space / Cmd+Space) to see available fields.
Missing Required Field¶
Error:
Cause: Required field omitted from override.
Invalid:
Valid:
Structure Errors¶
Array Expected¶
Error:
Cause: Single object used instead of array.
Invalid:
Valid:
Note the - before path. This indicates an array item.
Object Expected¶
Error:
Cause: Array used instead of object.
Invalid:
Valid:
YAML Syntax Errors¶
Indentation Error¶
Error:
Cause: Incorrect indentation (YAML is whitespace-sensitive).
Invalid:
Valid:
Duplicate Keys¶
Error:
Cause: Same field defined twice.
Invalid:
Valid:
For validation workflows and debugging strategies, see Validation Workflow.
Next Steps¶
- Validation Workflow: Step-by-step validation process, pre-commit hooks, CI validation, and debugging strategies
- Schema Reference: Complete field documentation
- IDE Setup: Configure validation in your editor
- Configuration File: Usage examples