Quick answer
YAML has strict rules for keys, values, colons, and quotes.
YAML Bad Syntax
YAML has strict rules for keys, values, colons, and quotes. Invalid characters, missing colons, or malformed flow (brackets/braces) cause the parser to fail.
Common causes
- Unquoted value containing a colon, hash, or special character that is interpreted as syntax.
- Missing space after colon in a key-value pair.
- Invalid or unclosed bracket or brace in flow style.
How to fix
- Use quotes for values that contain : # [ ] { } or start with a number or quote.
- Always put a space after the colon in key: value.
- Check that [ ] and { } are properly closed and commas used correctly in flow style.
Examples
Bad
key:value
Good
key: value
FAQ
- When do I need quotes in YAML?
- Quote values that contain reserved characters (: # [ ] { } ,) or that might be parsed as numbers/booleans (e.g. yes, no, 1.2).
- Is there a space after the colon in YAML?
- Yes. key: value requires a space after the colon.
Fix it now
Try in validator (prefill this example)