After migrating to Jersey 2.0, my REST service seems to serve up this boolean flag in a slightly different manner. (I can provide the Service code as well if it helps, but this seems pretty standard and just needs interperated different on the client)
{"incompleteFlag":{"valueType":"TRUE"}}
I think this is because the way the JSON is build was changed with the migration, but I used to interperate this fine using Java code like such:
boolean incompleteFlag = false;
JSONObject json = new JSONObject(response.readEntity(String.class));
//At this point in debugging, checking json variable looks good, as we seen above
incompleteFlag = json.getBoolean("incompleteFlag");
Obviously this does not work anymore since we now have a valueType to interperate. Any way to simply get this true/false flag? I've been trying to search out there, but not much luck.
Edit - Adding service code as well. I mentioned this in a comment, but I was having some serialization issues when trying to use the JSONObject instead of JsonObject from javax and that is why that aspect changed with the migration.
@GET
@Path("{employeeId}")
@Produces(MediaType.APPLICATION_JSON)
public Response produceJSON(@PathParam("employeeId") String empId){
System.out.println("Checking emp forms for " + empId);
boolean incompleteFlag = TAFactory.getHome().getIncompleteEmployeeForms(empId);
JsonObject myObject = Json.createObjectBuilder().add("incompleteFlag", incompleteFlag).build();
return Response.ok(myObject, MediaType.APPLICATION_JSON).build();
}