I was using the following to check if a json file was valid:
JsonParser parser = new JsonParser();
parser.parse(new String(Files.readAllBytes(Paths.get((filePath.toString())))));
But the json file I am validating has trailing commas like below that it doesn't throw an exception for:
"file":"hello.htm"},]
Since this is the last attribute the comma isn't needed and is causing trouble in other areas of our application. Is there a parser or some way to catch this trailing comma?
JsonParsertype is this?