4 ms·
> YAML is a JSON superset On the sense that any JSON file is a valid YAML file. But absolutely not in the sense that you can just treat your json file as YAML
by marcosdumay 3y ago
> YAML is a JSON superset
On the sense that any JSON file is a valid YAML file.
But absolutely not in the sense that you can just treat your json file as YAML and expect it to contain the correct data.
- skitter 3y agoHm, what JSON documents have a different meaning in YAML? I'd have hoped that with all names & strings being quoted and leading zeros being disallowed, that wouldn't be the case.
- zamalek 3y agoI have never come across a case where JSON can't take the place of YAML, but I guess there could be edge cases.
- marcosdumay 3y agoYou can easily corrupt the meaning of your JSON by adding whitespace in YAML.
- maple3142 3y agoMaybe duplicate keys in JSON counts? Some JSON parsers choose the first and some choose the last, and YAML directly forbid that.
- kunley 3y agoExactly my thought. Is it that an academic property, or are people serious about throwing JSON into running software that parses YAML and expect good results? (Should I add: on production, because I want my tools to be used on production, but that's just me)