> All this effort on building a better JSON parser for language 'X' should have been better spent on inventing a statically-typed JSON
how does that help when you want to implement a JSON-based protocol ?
how does that help when you want to implement a JSON-based protocol ?
E.g., an object's "foobar" field is always an array of int, and won't suddenly become a string from one invocation to the next.
It seems incredibly strange that we're somehow not leveraging this.
But this article isn't about those protocols. It's about JSON.
Here's a pure-JS solution: https://github.com/fastify/fast-json-stringify
If only… I had to figure out how to deserialize a JSON API where a field could be: a) an object X, b) an array of X, or c) a string (mapping to X.Y)