3 ms·
Would most of the footguns be solved by quoting all of the strings? e.g: "countries": - "ca" - "no" - "us"
by TrainedMonkey 5y ago
Would most of the footguns be solved by quoting all of the strings? e.g:
"countries":
- "ca"
- "no"
- "us"
- kevincox 5y agoYes, but now you are losing a lot of the clean syntax that causes most people to use YAML in the first place. There is a reason that most people don't write YAML like JSON with trailing commas and comments, it is nice to cut most of this noise.
- meowface 5y agoYou can also use a stricter subset of YAML that removes things like the "no" footgun. Plenty of such strict parsers exist across languages. Maybe it's no longer technically YAML at that point, but you get all the nice parts of YAML without having to revamp everything with static typing.