YAML Config
Web & DevelopmentYAML uses indentation to represent structured data/settings. Whitespace and scalar interpretation matter. Version/parser differences can change values, so check the consuming application.
- What it is used for
- Readable settings and structured data
- What the file contains
- Text
All sections, questions and sources
Content reviewed: · Editor:Kai
Opening steps
Choose your environment or purpose to see its steps.
Menu labels and support vary by app, OS and version. Preserve the original before making changes.
Troubleshooting by symptom
- Indentation error: check tabs and mismatched indentation levels.
- Unexpected scalar type: check version/parser rules and quote intended strings.
- Parsed but ineffective: check key names, hierarchy and application support.
- Indentation error: check consistent spacing and mixed tabs.
- yes/no are not strings: inspect parser/version typing and quote intended strings.
- Valid syntax but failed startup: inspect required keys, types and paths.
YAML → JSON
- Choose the intended YAML version/parser and read the document as data.
- Save JSON separately and compare types, arrays, multiple documents and anchor handling.
- Compare keys, record counts and types before/after conversion and document unsupported items.
Comments/presentation details normally disappear; custom tags or complex keys may not convert.
Preserving intended types
Consider quoting numeric/date-like values and yes/no when strings are intended; parser-version differences make type inspection important.
Anchors/aliases can reduce duplication; verify the application supports the resulting structure.
name: "example"
enabled: true
items:
- "001"
- "002"Source for these steps:YAML Project · YAML revision 1.2.2
Before converting YAML to JSON
Comments and anchors do not transfer identically to JSON. Verify semantic preservation.
Validate sensitive configuration locally rather than pasting it into online validators.
Source for these steps:YAML Project · YAML revision 1.2.2
Related-format differences
| Format | Main role | Selection notes |
|---|---|---|
| YAML / YML | Indented configuration/data | Inspect typing, spacing and version |
| JSON | Bracketed structured data | Does not retain comments |
| TOML | Table-oriented configuration | Syntax and consumers differ |
Handling and security
YAML may contain secrets; avoid unsafe object/tag construction and follow the application’s safe parsing guidance.
Questions and answers
Can tabs indent YAML?
Use spaces for YAML indentation.
Are YML and YAML different?
Normally they are alternative suffixes.
Do YAML 1.1 and 1.2 interpret everything identically?
No; scalar typing and other rules differ.
Are YAML and YML the same?
They generally denote the same format; use the filename required by the application.
Do backslashes in paths need care?
Escaping depends on quote style. Compare the documented example with parsed values.
Format facts: name, steward and MIME type
- Formal name
- YAML Ain’t Markup Language
- Steward / specification
- YAML language project / IETF media type registration
- MIME type
- application/yaml
Primary and official sources
- StandardYAML revision 1.2.2
Defines indentation, scalars, sequences and mappings.
YAML Project · Link checked: - StandardRFC 9512 — YAML Media Type
Documents application/yaml registration and filename extensions.
IETF / RFC Editor · Link checked: