While parsing a JSON, strange exception occurs as :This is not a JSON Array While parsing a JSON, strange exception occurs as :This is not a JSON Array json json

While parsing a JSON, strange exception occurs as :This is not a JSON Array


Because it is a Json Object

JsonObject json = json.get("clouds").getAsJsonObject()

It will work...

Or you can change the data as given below

{ "coord"  : {"lon":37.62,"lat":55.75}, "weather":{"id":803,"main":"Clouds","description":"test","icon":"04d"}, "base"   :"stations", "main"   :{"temp":12.76,"pressure":1007,"humidity":93,"tempmin":12,"tempmax":14}, "visibility":6000, "wind"   :{"speed":4,"deg":300}, "clouds" :[{"all":75}], "dt":1504881000, "sys"    :{"type":1,"id":7325,"message":0.0064,"country":"RU","sunrise":1504838942,"sunset":1504886617}, "id"     :524901, "name"   :"City", "cod"    :200 }