Validador YAML gratuito
El Validador YAML comprueba tu YAML en busca de los errores que rompen la mayoría de los archivos: indentación inconsistente, tabs, claves duplicadas y líneas clave/valor mal formadas. Informa del número de línea de cada problema.
The neighbouring validators are the JSON Validator, and the conversion between the two formats is handled by the YAML to JSON Converter and JSON to YAML Converter. For the tabular form, the YAML to CSV Converter is the next step.
Cómo usar Validador YAML
- 1 Paste your YAML or load a file.
- 2 Validate. Any error is reported with its line and the construct that failed.
- 3 Fix the reported line and validate again.
- 4 Check the parsed structure view to confirm the file means what you intended.
Cómo usarlo
Pega tu YAML y haz clic en Validar. Los problemas se listan con sus números de línea; si está limpio obtienes un resumen de la estructura.
- Detecta tabs usados para indentar
- Marca indentación inconsistente entre hermanos
- Encuentra claves duplicadas y líneas mal formadas
- Informa del número de línea de cada problema
- Se ejecuta enteramente en tu navegador
Errores comunes de YAML
YAML prohíbe tabs para indentar, exige espaciado consistente para claves hermanas y trata el espacio después de los dos puntos como significativo. Este validador detecta esos casos antes de que lleguen a tu pipeline de CI.
Preguntas frecuentes
Why is a tab an error rather than a warning?
Because the YAML specification does not permit tabs for indentation. A tab is a distinct character from a space, and a parser cannot reliably infer how many columns it occupies, so allowing it would make the file's meaning depend on a rendering convention. Its presence anywhere in the indentation is a hard error.
How do I fix "mapping values are not allowed in this context"?
Almost always an unquoted colon. A value such as a URL or a phrase containing a colon is parsed as the start of a nested mapping. Quoting the whole value, or using a block style, resolves it. This is the most common YAML error and it appears in configuration files containing anything resembling an address or a timestamp.
What does a duplicate key do?
It is an error in a strict validator, though some parsers silently take the last value. That divergence is dangerous precisely because it is silent — a file can appear to work while a whole configuration block is being discarded. A validator that reports duplicates is catching a real defect.
Herramientas para desarrolladores relacionadas
También te puede interesar
Herramientas de otras categorías que suelen combinarse con Validador YAML: