SyntaxFix
Write A Post
Hire A Developer
Questions
Try to use getAsJsonObject() instead of a straight cast used in the accepted answer:
getAsJsonObject()
JsonObject o = new JsonParser().parse("{\"a\": \"A\"}").getAsJsonObject();