JSON and data guides
JSON and YAML conversion: types, quotes and aliases
Keep strings as strings, understand YAML-only features, and inspect the converted document before reuse.
Quote values that must stay text
YAML is designed for readable structured data, but unquoted scalars can be interpreted as numbers, booleans or null according to the schema.
Quote opaque IDs and version-like values. Inspect the converted JSON rather than relying on how the YAML looked in the editor.
id: "00123"
active: true
note: null
→ {"id":"00123","active":true,"note":null}Indentation changes structure
YAML nesting depends on indentation. A list marker at the wrong level may create a different object without producing an obvious syntax error.
Use YAML Format first, then inspect JSON tree output. Keep a small nested record as a fixture to verify the intended array and object boundaries.
Know what cannot round-trip
JSON has no comments, anchors, aliases or custom YAML tags. Conversion may resolve aliases into repeated values and remove presentation details.
Do not use a data converter as a YAML source-preserving editor. Cyclic structures and custom tags require explicit handling outside ordinary JSON interchange.
Check the numeric boundary
YAML-to-JSON and JSON-to-YAML libraries may use native numeric types with their own precision limits. The ordinary JSON formatter’s lossless behavior is not a promise for every converter.
For very large integers, keep identifiers quoted or verify digits against the source. Revalidate the converted document against the consumer’s schema.