&)与别名(*)在转换时展开为实际内容。YAML to JSON Converter - Paste YAML text and convert it to formatted JSON with nested maps and lists. Free, browser-only.
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Mapping | YAML mappings to JSON objects; sequences to arrays | YAML 1.2 / RFC 8259 |
| Anchors | & anchors and * aliases must be expanded | YAML 1.2 |
| Key typing | JSON keys must be strings; convert others | RFC 8259 |
| 写法 | 含义 |
|---|---|
| key: value | 映射键值 |
| - item | 列表元素 |
| key: [a, b] | 行内列表 |
| # 注释 | 注释行 |
| key: 8080 # 端口 | 行尾注释(解析时剥离) |
| desc: | | 块标量(保留换行) |
| desc: > | 折叠块标量(换行折叠为空格) |