Good to know

  • Scalars follow the YAML 1.2 core schema, so no, yes, on and off are strings. YAML 1.1 read them as booleans — which is how a country code became false, and the reason that is remembered as the Norway problem.
  • Anything this reader does not fully implement is refused by name and by line rather than guessed at: tags, anchors and aliases, merge keys, explicit keys, more than one document in a stream, tabs used for indentation, and a key that appears twice. A subset parser is not a smaller correct parser — it is one that is wrong on the inputs nobody thinks to test.
  • Comments are not carried across. What comes out has the document's data, not its annotations — there is nowhere in JSON to put them.
  • Going the other way, anything that would read back as a number, a boolean or null is quoted. So are yes, no, on and off: they are strings here, but a YAML 1.1 reader somewhere else would take them for booleans.
  • An integer too large to survive as a double is kept as a string rather than silently rounded. A converter that returns a different number than it was given is worse than one that says it cannot.
17 views
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.