YAML → JSON / handoff guide
Hand off YAML to JSON without losing types
Before moving a configuration, check strings, booleans, null, and the boundaries that should stop a conversion.
YAML → JSON / handoff guide
Before moving a configuration, check strings, booleans, null, and the boundaries that should stop a conversion.
Similar-looking values can have different types. Quote identifiers and dates when their string meaning must survive the handoff.
id: "001"
enabled: false
label: on
date: "2026-10-01"
note: null| YAML | JSON type to check |
|---|---|
"001" | string; keeps the leading zero |
false | boolean |
on | check the string boundary explicitly |
"2026-10-01" | string, not an implicit date |
null | null |
The existing converter also runs locally. It does not upload, resolve external references, or perform schema validation.
| fixture | expected | why |
|---|---|---|
normal-types | convert | check quoted identifier/date, boolean, and null |
duplicate-key | reject / visible warning | do not silently choose last-key-wins |
alias-reference | warn | make reference meaning visible without external resolution |
cycle | reject | a cycle cannot become JSON |
oversized-deep | reject | crosses the 1 MiB or depth 32 boundary |
When you need to convert the input locally, use the existing YAML to JSON converter. This guide provides the decision points and handoff note.