I'm trying to consume this data
https://api.nasa.gov/neo/rest/v1/neo/browse?api_key=DEMO_KEY
following the tutorial from
I successfully retrieve the "links" and "page" portions of the data, but the array of near_earth_objects is null.
I tried what was suggested in this post:
But my situation is a little more complicated because it's more than just one array filled with objects as seen in
Top answer gives error:
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not
deserialize instance of java.lang.Object[] out of START_OBJECT token
Here is what my POJO looks like:
@JsonIgnoreProperties(ignoreUnknown = true)
public class NearEarthObjectBrowse {
@Id
private Links links;
private Page page;
private NearEarthObject[] near_earth_objects;
I also tried using a wrapper class for the NearEarthObject
array and still was unable to marshal successfully.
Is there a better way to go about doing this in general?
Edit: I believe the structure of NearEarthObject matches the data. Here is my github