WelcomeIt's good to be back. The blog had an expected hiatus while I moved to a new city, also around Seattle.
IntroMany of my posts are about overcoming unexpected difficulties when using some software library or module or another. I decided to take a step back and try to select a quality module in the first place. This is my analysis of the JSON libraries I was able to find and can count as a how-to to select a library in general.
The short result is that if a Library is in Maven, you can look at Maven Central to see how popular a library is and how frequently it is updated. Then you can use one of the most used and updated libraries out there. You can also consult StackOverflow. Here are some examples.
- JSR 353 - We have javax.json-api and org.glassfish/javax.json. Out of these two the
This could be you! Image from http://blog.smartbear.com
- Fast-XML Json Parsing / Jackson has many more updates (version 2.8), is far more used and the updates are fresher. That makes it the winner so far.
- JSON-Simple is comparable to the JSR 353 libraries. If not for the Jackson library you could choose based on how well prior Google libraries have worked vs Oracle libraries.
- org.json falls between Jackson and the JSR 353 libraries with about 700 users and a release in Feb of 2016.
- Google GSON has about 2000 users and was updated last month. This puts it on par with Jackson.
- quick-json has 0 users! This would make it almost unqualified even if there were no alternatives.
- JsonPath - Lastly, JsonPath has a couple of hundred users.
ConclusionNow, you may be skeptical of the Wisdom of the Crowd (e.g. appeal to the people or groupthink) but more users means that there is a higher chance someone found the same problems that you have. Even in this day and age Googling an error string can still produce 0 results.
Based off of this my project is using Jackson and hasn't had any problems with it for months.