Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Exactly 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)


Hm, 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.


Maybe duplicate keys in JSON counts? Some JSON parsers choose the first and some choose the last, and YAML directly forbid that.


I have never come across a case where JSON can't take the place of YAML, but I guess there could be edge cases.


You can easily corrupt the meaning of your JSON by adding whitespace in YAML.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: