Skip to content

Instantly share code, notes, and snippets.

@andykingking
Last active September 26, 2015 23:20
Show Gist options
  • Save andykingking/cce5d96a7f77865b41e1 to your computer and use it in GitHub Desktop.
Save andykingking/cce5d96a7f77865b41e1 to your computer and use it in GitHub Desktop.
YAML - Strange and complicated

The YAML spec is pretty complicated, and has alot of edge cases. If your whole document is

--- 
gjsogjsgj:gsdgs:sgdjsjgosdg: 

That's actually valid YAML. In some examples like:

--- 
thing1 
thing2 
thing3: 

The YAML isn't invalid until it hits line 4. Without the last colon, that would be valid YAML.

Here's the spec (it's a heavy read): http://www.yaml.org/spec/1.2/spec.html

And here's a convenient way to check out some YAML examples: http://www.yamllint.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment