All Versions
Latest Version
Avg Release Cycle
133 days
Latest Release

Changelog History
Page 2

  • v2.6.1 Changes

    February 12, 2016

    2016-02-11 GitHub Diff

    • Fix: The 2.6 release targeted Java 1.7, but we intend to target Java 1.6. The 2.6.1 release is identical to 2.6, but it targets Java 1.6.
  • v2.6 Changes

    February 11, 2016

    2016-02-11 GitHub Diff

    • Permit timezones without minutes in the default date adapter.
    • Update reader and writer for RFC 7159. This means that strings, numbers, booleans and null may be top-level values in JSON documents, even if the reader is strict.
    • New setLenient() method on GsonBuilder. This setting impacts the new factory method Gson.newJsonReader().
    • Adapters discovered with @JsonAdapter are now null safe by default.
  • v2.5 Changes

    2015-11-24 GitHub Diff

    • Updated minimum JDK version to 1.6
    • Improved Date Deserialization by accepting many date formats
    • Added support for 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.
    • Improved debugging information when some exceptions are thrown
  • v2.4 Changes


    • Drop IOException from TypeAdapter.toJson(). This is a binary-compatible change, but may cause compiler errors where IOExceptions are being caught but no longer thrown. The correct fix for this problem is to remove the unnecessary catch clause.
    • New: Gson.newJsonWriter method returns configured JsonWriter instances.
    • New: @SerializedName now works with AutoValue’s abstract property methods.
    • New: @SerializedName permits alternate names when deserializing.
    • New: JsonWriter#jsonValue writes raw JSON values.
    • New: APIs to add primitives directly to JsonArray instances.
    • New: ISO 8601 date type adapter. Find this in extras.
    • Fix: FieldNamingPolicy now works properly when running on a device with a Turkish locale.
  • v2.3.1 Changes


    • Added support to serialize objects with self-referential fields. The self-referential field is set to null in JSON. Previous version of Gson threw a StackOverflowException on encountering any self-referential fields.
      • The most visible impact of this is that Gson can now serialize Throwable (Exception and Error)
    • Added support for @JsonAdapter annotation on enums which are user defined types
    • Fixed bug in getPath() with array of objects and arrays of arrays
    • Other smaller bug fixes
  • v2.3 Changes


    • The new @JsonAdapter annotation to specify a Json TypeAdapter for a class field
    • JsonPath support: JsonReader.getPath() method returns the JsonPath expression
    • New public methods in JsonArray (similar to the java.util.List): contains(JsonElement), remove(JsonElement), remove(int index), set(int index, JsonElement element)
    • Many other smaller bug fixes
  • v2.2.4 Changes


    • Fix internal map (LinkedHashTreeMap) hashing bug.
    • Bug fix (Issue 511)
  • v2.2.3 Changes


    • Fixes for possible DoS attack due to poor String hashing
  • v2.2.2 Changes


    • Gson now allows a user to override default type adapters for Primitives and Strings. This behavior was allowed in earlier versions of Gson but was prohibited started Gson 2.0. We decided to allow it again: This enables a user to parse 1/0 as boolean values for compatibility with iOS JSON libraries.
    • (Incompatible behavior change in JsonParser): In the past, if JsonParser encountered a stream that terminated prematurely, it returned JsonNull. This behavior wasn't correct because the stream had invalid JSON, not a null. JsonParser is now changed to throw JsonSyntaxException in this case. Note that if JsonParser (or Gson) encounter an empty stream, they still return JsonNull.
  • v2.2.1 Changes


    • Very minor fixes