talira

FASTJSON 2

High-performance JSON library for Java, the successor to fastjson

open sourceApache-2.0free

FASTJSON 2 is Alibaba's JSON library for Java and the successor to fastjson 1.x. It parses JSON into JSONObject, JSONArray or your own classes and serializes objects back to JSON, and also reads and writes JSONB, its own binary format. JSONPath lets you extract parts of a document without parsing all of it, and it has JSON Schema validation, a Kotlin module and Spring integration. It runs on JDK 8 to 21, Android 8 and later, and GraalVM native images, and AutoType is off by default for safety. A compatibility package under fastjson's old Maven coordinates lets projects on fastjson 1.2.x move to it.

Problems it solves

  • parse and generate JSON quickly in a Java service
  • upgrade off an old fastjson 1.x version
  • read only part of a large JSON document in Java

Features

  • JSON and binary JSONB
  • partial parsing with JSONPath
  • JSON Schema validation
  • Kotlin module and Spring integration
  • fastjson 1.x compatibility package
  • GraalVM native image support

Alternatives

The same job

These do what FASTJSON 2 does.

  1. Jackson The Java JSON library: a suite of data-processing tools for Java and the JVM
  2. Gson Google's Java library for converting objects to and from JSON
  3. JSON-java (org.json) The reference JSON implementation for Java, in the public domain

Compare FASTJSON 2 with the top 3