[{"contacts": 
     [
        {
            "name": "Ramesh Sippi",
            "email": "ramesh.sippi@gmail.com",
            "phone": 9972366543,
            "officePhone": 80012345676,
            "latitude": 18.5204,
            "longitude": 73.8567
        }
    ]
}]
I tried to deserialize above JSON but it shows :
java.lang.IllegalStateException: Not a JSON Object
Deserializer class is:
public class Deserializer implements JsonDeserializer<List<ContactDetails>> {
@Override
public List<ContactDetails> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    String CONTACTS = "contacts";
    return new Gson().fromJson(json.getAsJsonArray().getAsJsonObject().getAsJsonArray(CONTACTS),typeOfT);
}}
Please help me out.Any resource or tutorial which helped you in deserialization.
 
     
     
     
    