- Comments are discarded
- JSON has no comment syntax, so YAML comments are discarded without a dedicated result warning. A # inside a quoted string is still data, not a comment. Keep the YAML as your source of truth if its documentation matters.
- Anchors and aliases are expanded inline
- YAML lets you define a block with &name and reuse it with *name, including merge keys (<<). Supported aliases are expanded into JSON values, so shared references are no longer visible and output can grow. The parser uses maxAliasCount: 100 to limit alias expansion; this is not a nesting-depth limit or a promise that 100 aliases always succeed. Circular references cannot be serialised as JSON.
- Multi-document streams are rejected
- A YAML file can hold several documents separated by ---, as Kubernetes manifests often do. This converter rejects such a stream without returning partial JSON. Split it and convert each document separately. A single document may still begin with ---; a heuristic warning can incorrectly say only the first document was converted, for example after a version directive.
- Keys become strings
- YAML permits non-string mapping keys, but the parser produces JavaScript objects whose keys are strings. A key like 2024: becomes "2024", and complex keys get a textual representation rather than preserving their structure. Distinct keys such as 1 and "1" can collide and overwrite a value. Repeated plain string keys such as a: are rejected, but complex, alias or NaN keys can still collide after conversion. Key warnings are heuristic and can miss conversions or flag already quoted keys.
- Implicit typing catches people out
- Without a version directive, the parser uses the YAML 1.2 core schema: yes, no, on and off stay strings, while true and false are booleans and 1.0 is a number. An explicit %YAML 1.1 directive enables older typing rules. JavaScript IEEE 754 numbers can round large integers or precise decimals; .inf, -.inf, .nan and numeric overflow become null in JSON, and negative zero becomes 0. Quote values that must remain exact text.