News for hackers. Stuff that matters.
Re:Ask HN: If Kubernetes is the solution, why are there so m... by krapp on Wednesday June 01, 2022 @01:07PM (#31584879)
This discussion from a couple of weeks ago suggests it isn't that simple: not all valid JSON is always valid YAML if your definition of superset requires that JSON would be parsed the same with a YAML parser as with a JSON parser.

If you're going to use JSON for config, it's better to use an actual JSON parser.

https://john-millikin.com/json-is-not-a-yaml-subset https://news.ycombinator.com/item?id=31406473

Re:Ask HN: If Kubernetes is the solution, why are there so m... by rustyminnow on Wednesday June 01, 2022 @01:22PM (#31585096)
Thanks! That's really interesting.

You could mitigate some of the issues and get JSONs "strictness as a feature" by passing the document through e.g. `jq . $file` as a CI step, but I don't think that'd resolve the 1e2 issue. TBH I didn't know you could write numbers in JSON like that, so I imagine it'd be an issue that doesn't come up often. But it's disappointing that it wouldn't just work.