title: Jackson JsonParser fails reading an array in Json
body: <p>I have a Json Structure something like this</p>
  
  <pre><code>{
  "name" : "abcd",
  "details" : [{"city":"string", "zipcode":"integer"}],
  
  "name" : "qwert",
  "details" : [{"address":"long", "state":"string"}]
  }
  </code></pre>
  
  <p>And my java code looks like below</p>
  
  <pre><code>public class JsonTest {
  
      public static void main(String[] args) throws JsonParseException, IOException {
  
          JsonFactory jf = new JsonFactory(); 
          JsonParser jp = jf.createParser(new File("C:\\sample.json"));
  
          while (jp.nextToken() != JsonToken.END_OBJECT)
          {
              String jsonField = jp.getCurrentName();
  
              if ("name".equalsIgnoreCase(jsonField))
              {
                  jp.nextToken();
                  System.out.println(jp.getText());
              }
  
              if ("details".equalsIgnoreCase(jsonField))
              {
                  jp.nextToken();
                  while (jp.nextToken() != JsonToken.END_ARRAY)
                  {
                      jp.nextToken();
                      String field = jp.getText();
                      System.out.println(field);
                  }
              }
          }           
      }
  
  }
  </code></pre>
  
  <p>All am trying to do is parse the whole json token by token and get the text. But the line <code>while (jp.nextToken() != JsonToken.END_OBJECT)</code> fails when it encounters a '}' in the array. Am just stuck here since yesterday and experimenting with several other tricks but nothing works out. Do we have another way doing this? Is my JSON structure looks okay? Please tell me where am going wrong. Thanks!</p>