java - How to parse the below json using Google GSON library? -


This is my Jason response that I'm getting from the server,

  {"awards ": When I'm trying to use the code below it    @ Serialized Names (" Award ") Personal User Award [] Award; Public class UserAwards {}   

This is giving me the following exception:

  com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT But the line 1 column at 247 is STRING.   

Please help me find out how I can parse it.

Check this if you are not able to do Jason for the object.

  Import java.util.ArrayList; Import java.util.list; Import javax.annotation.Generated; Import javax.validation.Valid; Import com.google.gson.annotations.Expose; @ Generated ("org.jsonschema2pojo") Public Category UserAwards {@Expose @Valid Private List & lt; String & gt; Awards = new arreelists & lt; String & gt; (); Public listing & lt; String & gt; Award () {Return Award; } Public Zero Set Award (List & lt; String & gt; Awards) {this.awards = Awards; }}    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -