These are chat archives for hseeberger/akka-http-json

12th
Jul 2017
golokeshpatra45
@golokeshpatra45
Jul 12 2017 12:49

This is my JSON -
[{
"app_site": "eventsubscribers",
"app_branch": "master",
"app_dbhash": false,
"app_env": "production",
"app_rev": "1.0.0.0",
"app_tar": "eventsubscribers-master-1.0.0.0.tar"
},
{
"app_site": "subscribers",
"app_branch": "master",
"app_dbhash": false,
"app_env": "production",
"app_rev": "1.0.0.0",
"app_tar": "subscribers-master-1.0.0.0.tar"
}]
This is my controller -
@RestController
public class statusController {
@RequestMapping("/test")
public status getAllstatus() throws IOException, IllegalAccessException, Throwable, Exception{

    byte[] jsonData=Files.readAllBytes(Paths.get("C:/Users/patrag/workspace/com.json2rest/ver.json"));
    ObjectMapper objectMapper = new ObjectMapper();
    status stat1 = objectMapper.readValue(jsonData, status.class);

    return stat1;
}

}

Now I want both the app_sites followed by their respective app_tar in the browser. How should I proceed ?