import_username
import_username

Reputation: 13

Best way to approach consuming large json payload in Spring?

So I am using Reddit's rest api to be able to take all the articles from a subreddit. This gives me a large json, which leaves me confused on how I should approach consuming this json via rest template. My first thought to create an Object class which maps perfectly with the json and then use Gson or jackson. This is very daunting as there are so many fields in the json that I was wondering if there was a better way to do this.

Thanks for any help

Upvotes: 1

Views: 801

Answers (1)

Don Hosek
Don Hosek

Reputation: 1033

You can specify that unknown fields be ignored in Jackson and only define those fields that you care about in your object model.

Upvotes: 2

Related Questions