Asked about Streaming a response

Would you stream a response that must be valid JSON?

An answer that works

There is little point. You cannot use it until it is complete, so streaming only gives you a progress indicator. Stream prose to users, and buffer anything you intend to parse.

Then they push further

What if the user needs to see progress?

Stream status updates or a separate readable field while the structured result is produced, and parse the JSON only once it is complete. Stream partial JSON with a tolerant parser only if the interface truly needs it.

What gets marked up

Marked up for noting that JSON cannot be validated until it is complete, so streaming helps the person watching but not the program consuming the result.

Reading an answer is not being able to give one. The section that teaches this is Streaming a response, 5 hours of Streaming responses.

Learn this properly