How I read YAML without getting lost in indentation
· 2 min read
YAML is readable when indentation is correct and confusing when it is not. A viewer helps validate and inspect the structure.
The YAML Viewer tool is useful because it lets me check the result in a small, controlled place before I use it in a bigger workflow.
The simple idea
YAML is readable when indentation is correct and confusing when it is not. A viewer helps validate and inspect the structure.
The goal is not to click buttons quickly. The goal is to understand the input, produce the expected output, and notice anything that could be misleading.
Step 1: Paste the YAML into the viewer
Paste the YAML into the viewer.
Start with a small example if possible. Small examples make mistakes easier to see.
Step 2: Fix syntax or indentation errors first
Fix syntax or indentation errors first.
Step 3: Expand the tree to see objects and arrays
Expand the tree to see objects and arrays.
Step 4: Check whether a value is a string, number, boolean, or null
Check whether a value is a string, number, boolean, or null.
Step 5: Watch list indentation carefully
Watch list indentation carefully.
Step 6: Compare the tree with what the application expects
Compare the tree with what the application expects.
Step 7: Avoid tabs; use spaces consistently
Avoid tabs; use spaces consistently.
My checklist
Before I trust the result, I check:
- Paste the YAML into the viewer.
- Fix syntax or indentation errors first.
- Expand the tree to see objects and arrays.
- Check whether a value is a string, number, boolean, or null.
- Watch list indentation carefully.
- Compare the tree with what the application expects.
- Avoid tabs; use spaces consistently.
The tool handles the mechanical part. I still review the result before I publish it, send it, or use it in production.
Comments
Comments are welcome — please read the comment policy first. Powered by giscus and GitHub Discussions.