name: ExpressYou
plan: premium
active: trueMappings are the YAML equivalent of objects or dictionaries. Keys should be consistent and human readable.
Core YAML syntax, indentation rules, maps, lists, and practical validation commands for day-one and day-100 YAML workflows.
Core YAML building blocks and the examples people search for most.
name: ExpressYou
plan: premium
active: trueMappings are the YAML equivalent of objects or dictionaries. Keys should be consistent and human readable.
features:
- message generator
- fix this message
- screenshot to replySequences are the YAML equivalent of arrays or lists.
app:
name: ExpressYou
pricing:
monthly: 7.99
yearly: 59.99
tools:
- coach me
- message generatorNested indentation controls structure. Spaces matter; tabs should be avoided.
draft: null
enabled: true
max_retries: 3
price: 7.99Use plain scalars carefully. YAML has implicit typing rules, so quoting can help avoid ambiguity.
Practical commands that make YAML easier to work with in local and CI workflows.
yamllint config.yaml`yamllint` is a standard first pass for catching indentation, trailing spaces, duplicate keys, and other issues.
Quickly verify that a YAML file loads successfully.
python - <<'PY'
import yaml
with open('config.yaml') as f:
print(yaml.safe_load(f))
PYUseful when you already have Python and PyYAML available and want a fast sanity check.
yq '.' config.yamlGreat for validating structure and making machine-generated YAML easier to inspect.
Check whether a manifest parses before applying it.
kubectl apply --dry-run=client -f deployment.yamlThis catches many structural issues in Kubernetes manifests before they hit the cluster.