Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Fastjson | 25,342 | 20 days ago | 1 | April 18, 2022 | 2,010 | apache-2.0 | Java | |||
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade. | ||||||||||
Gson | 22,157 | 99,316 | 6,653 | 13 hours ago | 36 | February 11, 2022 | 394 | apache-2.0 | Java | |
A Java serialization/deserialization library to convert Java Objects into JSON and back | ||||||||||
Go | 12,295 | 5,834 | 10,873 | 3 days ago | 16 | September 11, 2021 | 239 | mit | Go | |
A high-performance 100% compatible drop-in replacement of "encoding/json" | ||||||||||
Arduinojson | 6,146 | 14 days ago | 25 | mit | C++ | |||||
📟 JSON library for Arduino and embedded C++. Simple and efficient. | ||||||||||
Orjson | 4,638 | 14 | 534 | 3 hours ago | 92 | July 06, 2022 | 3 | apache-2.0 | Python | |
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy | ||||||||||
Handyjson | 4,120 | 214 | 25 days ago | 32 | February 28, 2020 | 216 | other | Swift | ||
A handy swift json-object serialization/deserialization library | ||||||||||
Fastjson2 | 2,761 | 33,509 | 2,334 | 2 days ago | 289 | September 19, 2022 | 152 | apache-2.0 | Java | |
🚄 FASTJSON2 is a Java JSON library with excellent performance. | ||||||||||
Yyjson | 2,481 | 15 days ago | 6 | mit | C | |||||
The fastest JSON library in C | ||||||||||
Jsonmapper | 1,484 | 702 | 208 | 10 days ago | 36 | December 01, 2020 | 2 | osl-3.0 | PHP | |
Map nested JSON structures onto PHP classes | ||||||||||
Java | 1,373 | 113 | 37 | a year ago | 22 | July 03, 2018 | 83 | mit | Java | |
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go |
Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.
There are a few open-source projects that can convert Java objects to JSON. However, most of them require that you place Java annotations in your classes; something that you can not do if you do not have access to the source-code. Most also do not fully support the use of Java Generics. Gson considers both of these as very important design goals.
ℹ️ Gson is currently in maintenance mode; existing bugs will be fixed, but large new features will likely not be added. If you want to add a new feature, please first search for existing GitHub issues, or create a new one to discuss the feature and get feedback.
toJson()
and fromJson()
methods to convert Java objects to JSON and vice-versaGradle:
dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
}
Maven:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
Gson jar downloads are available from Maven Central.
Despite supporting older Java versions, Gson also provides a JPMS module descriptor (module name com.google.gson
) for users of Java 9 or newer.
These are the optional Java Platform Module System (JPMS) JDK modules which Gson depends on. This only applies when running Java 9 or newer.
java.sql
(optional since Gson 2.8.9)
When this module is present, Gson provides default adapters for some SQL date and time classes.
jdk.unsupported
, respectively class sun.misc.Unsafe
(optional)
When this module is present, Gson can use the Unsafe
class to create instances of classes without no-args constructor.
However, care should be taken when relying on this. Unsafe
is not available in all environments and its usage has some pitfalls,
see GsonBuilder.disableJdkUnsafe()
.
CHANGELOG.md
Please use the 'gson' tag on StackOverflow or the google-gson Google group to discuss Gson or to post questions.
StudyTrails
Future Studio
Gson uses Maven to build the project:
mvn clean verify
JDK 11 or newer is required for building, JDK 17 is recommended.
See the contributing guide.
Please perform a quick search to check if there are already existing issues or pull requests related to your contribution.
Keep in mind that Gson is in maintenance mode. If you want to add a new feature, please first search for existing GitHub issues, or create a new one to discuss the feature and get feedback.
Gson is released under the Apache 2.0 license.
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This is not an officially supported Google product.