Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Gson
Version 2.8
2016-10-26 GitHub Diff
TypeToken.getParameterized()
andTypeToken.getArray()
make it easier toregister or look up a
TypeAdapter
.@JsonAdapter(nullSafe=true)
to specify that a custom type adapter handles null.Version 2.7
2016-06-14 GitHub Diff
Version 2.6.2
2016-02-26 GitHub Diff
Version 2.6.1
2016-02-11 GitHub Diff
2.6.1 release is identical to 2.6, but it targets Java 1.6.
Version 2.6
2016-02-11 GitHub Diff
booleans and null may be top-level values in JSON documents, even if the
reader is strict.
setLenient()
method onGsonBuilder
. This setting impacts the newfactory method
Gson.newJsonReader()
.@JsonAdapter
are now null safe by default.Version 2.5
2015-11-24 GitHub Diff
java.util.Currency
,AtomicLong
,AtomicLongArray
,AtomicInteger
,AtomicIntegerArray
,AtomicBoolean
. This change is backward-incompatible because the earlier version of Gson used the default serialization which wasn't intuitive. We hope that these classes are not used enough to actually cause problems in the field.Version 2.4
2015-10-04
IOException
fromTypeAdapter.toJson()
. This is a binary-compatible change, but maycause compiler errors where
IOExceptions
are being caught but no longer thrown. The correct fixfor this problem is to remove the unnecessary
catch
clause.Gson.newJsonWriter
method returns configuredJsonWriter
instances.@SerializedName
now works with [AutoValue’s][autovalue] abstract property methods.@SerializedName
permits alternate names when deserializing.JsonWriter#jsonValue
writes raw JSON values.JsonArray
instances.FieldNamingPolicy
now works properly when running on a device with a Turkish locale.[autovalue]: https://github.com/google/auto/tree/master/value
Version 2.3.1
2014-11-20
Version 2.3
2014-08-11
contains(JsonElement), remove(JsonElement), remove(int index), set(int index, JsonElement element)
Version 2.2.4
2013-05-13
Version 2.2.3
2013-04-12
Version 2.2.2
2012-07-02
JsonParser
): In the past, ifJsonParser
encountered a stream that terminated prematurely, it returnedJsonNull
. This behavior wasn't correct because the stream had invalid JSON, not a null.JsonParser
is now changed to throwJsonSyntaxException
in this case. Note that if JsonParser (or Gson) encounter an empty stream, they still returnJsonNull
.Version 2.2.1
2012-05-05
Version 2.2
2012-05-05
Version 2.1
2011-12-30 (Targeted Dec 31, 2011)
Version 2.0
2011-11-13
Faster
More Predictable
Changes to watch out for
Gson 1.7 would serialize top-level nulls as "". 2.0 serializes them as "null".
Gson 1.7 permitted duplicate map keys. 2.0 forbids them.
Gson 1.7 won’t serialize subclass fields in collection elements. 2.0 adds this extra information.
Gson 1.7 binds single-element arrays as their contents. 2.0 doesn’t.
Other changes to be aware of