@app.route("<STR_LIT>")<EOL>def stream_n_messages(n):
response = get_dict("<STR_LIT:url>", "<STR_LIT:args>", "<STR_LIT>", "<STR_LIT>")<EOL>n = min(n, <NUM_LIT:100>)<EOL>def generate_stream():<EOL><INDENT>for i in range(n):<EOL><INDENT>response["<STR_LIT:id>"] = i<EOL>yield json.dumps(response) + "<STR_LIT:\n>"<EOL><DEDENT><DEDENT>return Response(generate_stream(), headers={"<STR_LIT:Content-Type>": "<STR_LIT:application/json>"})<EOL>
Stream n JSON responses
    ---
    tags:
      - Dynamic data
    parameters:
      - in: path
        name: n
        type: int
    produces:
      - application/json
    responses:
      200:
        description: Streamed JSON responses.