4 ms·
See also my post: You Are Doing JSON-APIs Wrong https://news.ycombinator.com/item?id=31258658 https://news.ycombinator.com/item?id=31258658 JSON can be parsed
by FeepingCreature 4y ago
See also my post: You Are Doing JSON-APIs Wrong https://news.ycombinator.com/item?id=31258658 https://news.ycombinator.com/item?id=31258658
JSON can be parsed linearly so long as every key fully determines the format of the value.
- kelnos 4y agoCan be, sure. But in practice that's not very useful: 1. Client libraries may not send keys in a defined order, so the key that tells the server what method to call might end up in the middle or end of the payload. 2. The vast majority of default or common JSON parsers out there for the various languages and frameworks most people use just don't support incremental parsing. Your post isn't particularly relevant, since it proscribes a different way of structuring your payloads than JSON-RPC (and others). It doesn't matter if these others are "wrong"; they exist, and have wide support, so people will gravitate to them, rather than rolling their own.
- FeepingCreature 4y agoI'm aware! My faint hope is if I spread the word, maybe JSON-RPC 2 will not be bad in this way.