#StackBounty: #java #json #jackson Parsing an array of non-homogeneous JSON Objects with Jackson

Bounty: 50

I have a situation where I need to parse an array of JSON objects that are not identical.

So for example:

[
{ "type": "type1", ..... type1 contents .... },
{ "type": "type2", ..... type2 contents .... },
....
{ "type": "type1", ..... type1 contents .... }
]

The number of types is limited and the contents of each type are well can be defined but it is not possible to define a single type of object that will hold the contents.

Is there a way to parse them with Jackson?

P.S. I am trying to avoid writing a custom parser if I can help it.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.