Sample code of JSON:
[
{
"name":"Norway",
"languages":[
"no",
"nb",
"nn"
]
}
]
I'm trying to use Java to validate the response "languages" contains "no", and my code below fyi but how can I validate this, appreciate any responses.
//Fetching response in JSON
JSONArray jsonResponse = new JSONArray(resp.asString());
//Fetching value of languages parameter
JSONArray languages = jsonResponse.getJSONObject(0).getJSONArray("languages");