I want to get all the "name" of these Json, I tried iterator and mapString, but without success, the result is always NULL.
try {
JSONParser parser = new JSONParser();
JSONObject json = (JSONObject) parser.parse(responseBody);
System.out.println("Parseamento: " + json);
String projectName = (String) json.get("name");
System.out.println("Count: " + projectName);
} catch (Exception e) {
// TODO: handle exception
}
This is the answer Json
{
"count":02,
"value":[
{
"visibility":"private",
"name":"New Business",
"description":"",
"id":"",
"state":"wellFormed",
"url":"https:\/\/dev.azure.com\/work\/_apis\/projects\/ac9f8ec3-cb2c-4db9-b600-47e34b217e97",
"revision":434,
"lastUpdateTime":"2021-01-08T14:18:01.387Z"
},
{
"visibility":"private",
"name":"Doctor Strange",
"id":"d0fa6bda-0699-4c33-a24f-c9dbe9655bdb",
"state":"wellFormed",
"url":"https:\/\/dev.azure.com\/work\/_apis\/projects\/d0fa6bda-0699-4c33-a24f-c9dbe9655bdb",
"revision":330,
"lastUpdateTime":"2020-10-01T17:57:23.58Z"
}
]
}
com.googlecode.json-simple json-simple 1.1.1