Skip to content
Advertisement

Parse a json list into list of object Java

I have a response as follows

JavaScript

I want to map this json to a POJO object and have created this class

JavaScript

I am currently using this way to read this

JavaScript

The size of events is 2 but each event is coming as null instead of a map.

Can Someone please help me ?

Advertisement

Answer

To achieve your goal you have to adjust your JSON as follows:

JavaScript

Notice the event fields that have been added.

Or, change your DTO, like this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement