title: Weird behavior while parsing Json with a DoFn
body: <p>I am trying to parse some Json that I have stored in google cloud storage. I am using apache beam to create a pipeline that reads the json stored and then writes it to a cloud sql database. I have encounter some weird behavior while writing my parse method. </p>
  
  <p>Here is my Json:</p>
  
  <pre><code>        [{
              "projectid": "Reminder101",
              "reminderkey": "001",
              "localid": "01",
              "timestamp": "2018-01-24 12:00"
          },
          {
              "projectid": "Reminder101",
              "reminderkey": "002",
              "localid": "02",
              "timestamp": "2018-01-25 9:00"
          },
          {
              "projectid": "Reminder101",
              "reminderkey": "003",
              "localid": "03",
              "timestamp": "2018-02-01 18:00"
          },
          {
              "projectid": "Reminder101",
              "reminderkey": "004",
              "localid": "04",
              "timestamp": "2018-02-6 15:35"
          },
          {
              "projectid": "USReminder101",
              "reminderkey": "001",
              "localid": "01",
              "timestamp": "2018/01/30 21:00"
          }
      ]
  </code></pre>
  
  <p>Here is my json parse method(JsonHolder is just a pojo):</p>
  
  <pre><code>static class ParseJsonDoFn extends DoFn&lt;String, List&lt;JsonHolder&gt;&gt; {
    @ProcessElement
    public void processElement(ProcessContext context) {
      String incomingInfo = context.element();
      Gson gson = new Gson();
      System.out.println(incomingInfo.toString());
      Type type = new TypeToken&lt;List&lt;JsonHolder&gt;&gt;(){}.getType();
      List&lt;JsonHolder&gt; jsonholders = gson.fromJson(incomingInfo, type);
      context.output(jsonholders);
    }
  }
  </code></pre>
  
  <p>Now when I run my pipeline like this I get the error:</p>
  
  <pre><code>Exception in thread "main" 
  org.apache.beam.sdk.Pipeline$PipelineExecutionException: 
  com.google.gson.JsonSyntaxException: 
  com.google.gson.stream.MalformedJsonException: Expected value at line 1 
  column 2 path $
  </code></pre>
  
  <p>The System.out.println(); shows:</p>
  
  <pre><code>"timestamp": "2018-02-01 18:00"
  },
      "reminderkey": "004",
  [{
      "localid": "01",
  },
      "timestamp": "2018-01-24 12:00"
      "reminderkey": "002",
  </code></pre>
  
  <p>But, if I create a Json file that is a single line that is not formatted it parses fine. What I can deduce is that the Json file is being split after each end of line, but I cannot for the life of me figure out why or how to correct it.</p>
  
  <p>Cheers. </p>