[Solved] Basic Gson Help [closed]
Here’s an example that matches the structure in the question. input.json contents: { “next”:”uri-to-next-page”, “previous”:”uri-to-previous-page”, “total”:12, “buy_on_site”:true, “resource_uri”:”uri-to-resource-1″, “resource”: { “publisher”: { “name”:”publisher name 1″, “resource_uri”:”uri-to-resource-2″ }, “book_images”: { “image_url”:”url-to-image”, “file_type”:”PNG”, “name”:”book-image-name” }, “author”: { “name”:”author-name”, “resource_uri”:”uri-to-resource-3″ } } } The code to deserialize it: import java.io.FileReader; import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class … Read more