Now I am getting this JSON from API:
{\"supplyPrice\": {
\"CAD\": 78,
\"CHF\": 54600.78,
\"USD\": 20735.52
}}
But
We are only one line of code away from converting jsonObjects to arrays(Not jsonArrays but after making it a arrayList you can create jsonArray too,easily.)
fun jsonObjectToArray(jsonObject : JsonObject,listTypeClass : Class) = arrayListOf().apply { jsonObject.keySet().forEach { this.add(Gson().fromJson(jsonObject.get(it).toString(),listTypeClass))}}