5 ms·
As the article points out with the `on` example, you really have to quote yaml keys as well, if you want the defense to work...
by montroser 1y ago
As the article points out with the `on` example, you really have to quote yaml keys as well, if you want the defense to work...
- lillesvin 1y agoThe argument was that most of the mentioned problems could be solved by quoting the values. I don't have a problem with avoiding "on" as a key, and I apparently haven't used it ever, because I've never run into this particular problem in my 15+ years using YAML. So, sure, if you want to play it super safe, quote keys as well. But I'm personally fine with the trade-off in not quoting keys.
- Dylan16807 1y agoIf you compare to JSON5 instead of JSON, you still get the benefit of unquoted keys, but you also get a guarantee the keys are strings, and it's harder to forget to quote a value.