YAML 转 JSON
YAML 实时转 JSON:映射/列表/类型规则映射为 JSON 原生值;tab 缩进报错显示行号,yes→true 一目了然。
Supported syntax
This parser covers the common block-style YAML subset: nested mappings (key: value), sequences (- item), quoted strings ('single' and "double"), numbers, true/false/null/~, inline flow arrays [a, b] and objects {k: v}, comments (# outside quotes). Blank lines end nothing — nesting is decided by indentation only. Multi-line block scalars (|, >) and anchors/aliases (&, *) are intentionally not supported.
如何使用YAML 转 JSON
粘贴 YAML,JSON 等价物实时出现:嵌套映射变对象、列表变数组,YAML 类型规则(整数、浮点、布尔、null)映射为 JSON 原生值。一键复制,或按偏好宽度美化输出。
它把经典 YAML 陷阱摆到明面上:裸 yes 变成 true、挪威问题(国家码 NO 变 false)、缩进里的 tab——以行号拒绝而非神秘报错。看清“实际解析成了什么”,比事后追查省一个下午。