I have the following code for parsing json data in a file with Jackson.
ObjectMapper mapper = new ObjectMapper();
JsonFactory jsonFactory = new JsonFactory();
try(BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/foos.json")))) {
Iterator<Foo> fooItr = mapper.readValues( jsonFactory.createParser(br), Foo.class);
fooItr.forEachRemaining(System.out::println);
}catch(Exception ex){ .. }
don't work for a JSon array in a format as
[
{...},
{...}
]
but work for a format
{...}
{...}
What will be a proper parsing method for the JSon array format?