HNNewShowAskJobs
Built with Tanstack Start
Just say no to broken JSON(lemire.me)
8 points by ingve 19 hours ago | 4 comments
  • chrisjj19 hours ago

    > {"key": "value\nda"}

    > My convention is that \n is the one-byte ASCII control character linefeed. This JSON is not valid.

    How is this not valid?

    • rurban19 hours ago |parent

      Daniel seems to be pretty confused on this one. All examples produce the correct error response.

    • orangecat19 hours ago |parent

      That confused me too, apparently it needs to be "\\n".

      • chrisjj4 hours ago |parent

        /He/ may need it to be //n, but JSON does not. It is valid. https://jsonlint.com/ confirms.