YAML Format Example
A small but complete sample that shows the core building blocks.
A readable example
# A map (key-value pairs)
name: YAMLTools
private: true # booleans are inferred
level: 3 # numbers are inferred
# A list of strings
features:
- browser-based
- no-upload
# A nested map
config:
indent: 2
services:
- name: api
port: 8080
What each part means
- Maps use
key: value; nesting comes from indentation. - Lists use a
-dash per item. - Types (string, number, boolean) are inferred from the value.
- Comments start with
#— something JSON cannot do.
Try it on your own YAML
Paste your text into the YAML formatter to normalize indentation, or the YAML validator to catch syntax errors. New to the format? Start with What is YAML?