3 ms·
We pretty much just use JSON exclusively, since JSON is also valid YAML (another bizarre design decision in YAML, but a blessed escape hatch for me). That is,
by smt88 5y ago
We pretty much just use JSON exclusively, since JSON is also valid YAML (another bizarre design decision in YAML, but a blessed escape hatch for me).
That is, I suppose, a strike against YAML: we just "downgrade" to JSON and never have any issues.
- bmn__ 5y ago> JSON is also valid YAML That's false. http://p3rl.org/JSON::XS#JSON-and-YAML http://p3rl.org/JSON::XS#JSON-and-YAML
- GoblinSlayer 5y agoOuch, I routinely see \/ in json in the wild. What happens outside of BMP? JSON escapes surrogate pair as two UTF-16 code units separately.
- smt88 5y agoThat link is from more than 10 years ago and is no longer accurate as of YAML 1.2[1]. Perfect JSON compatibility has always been a stated goal of YAML and is something they consider to be a bug when it's found to be broken at the spec level. 1. https://yaml.org/spec/1.2.2/ https://yaml.org/spec/1.2.2/
- bmn__ 5y agoIf you read the linked document carefully, then you will notice that YAML 1.2 existed twelve years ago, the incompatibility has not been addressed as suggested and remains still a problem for the end users.
- diob 5y agoWait really? I never knew that. I absolutely fail at whitespace delimited things like YAML and Python, I just can't handle it mentally.
- smt88 5y agoIt's true. YAML is a superset of JSON[1]. I agree that it is surprising (in a bad way) and makes no sense. 1. https://octopus.com/blog/state-of-config-file-formats#:~:text=Although%20YAML%20looks%20different%20to,JSON%20in%20its%20configuration%20files https://octopus.com/blog/state-of-config-file-formats#:~:tex....