Json parser to catch trailing commas in Java?
<p>I was using the following to check if a json file was valid:</p>

<pre><code>JsonParser parser = new JsonParser();   
parser.parse(new String(Files.readAllBytes(Paths.get((filePath.toString())))));
</code></pre>

<p>But the json file I am validating has trailing commas like below that it doesn't throw an exception for:</p>

<pre><code>"file":"hello.htm"},]
</code></pre>

<p>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?</p>