I would like to validate the JSON being passed in, currently the method is not parsing the JSON and bad json will go on to break everything, and I imagine security exploits can be built into a bad JSON string as well.
JsonParser parser = new JsonParser();
JsonObject bodyvar = parser.parse(params.get("body")).getAsJsonObject();
How can I check validate the JSON? (ideally I can get a boolean value or a 1 or 0 returned, so I can construct this method conditionally. Or if there is a try/catch that comes with the JSONParser for validation, that would be cool too)
edit: using GSON library (and I'll be looking at the GSON reference while I wait for answers here)