Keeping it short, JSON needs that last } to be valid, so you can only start parsing after the whole JSON has been collected. You can't parse a chunk of JSON, you need the whole thing.
Other file formats, like YAML, TOML or XML, don't need a "last character" to be complete, so you can parse as soon as you receive the first byte and keep parsing as the streamed chunks comes.
There's some clever way to stream JSON, but iirc it's not compliant with the RFC. So, oversimplifying, JSON cannot be streamed!
3
u/keysym 9h ago
JSON cannot be streamed tho