mirror of
https://github.com/fankes/moshi.git
synced 2025-10-21 08:59:20 +08:00
Update changelog for Moshi 1.2.0.
This commit is contained in:
41
CHANGELOG.md
41
CHANGELOG.md
@@ -1,6 +1,30 @@
|
|||||||
Change Log
|
Change Log
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
## Version 1.2.0
|
||||||
|
|
||||||
|
_2016-05-28_
|
||||||
|
|
||||||
|
* New: Take advantage of Okio's new `Options` feature when reading field names and enum values.
|
||||||
|
This has a significant impact on performance. We measured parsing performance improve from 89k
|
||||||
|
ops/sec to 140k ops/sec on one benchmark on one machine.
|
||||||
|
* New: Upgrade to Okio 1.8.0.
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okio</groupId>
|
||||||
|
<artifactId>okio</artifactId>
|
||||||
|
<version>1.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
* New: Support types that lack no-argument constructors objects on Android releases prior to
|
||||||
|
Gingerbread.
|
||||||
|
* Fix: Add writer value overload for boxed booleans. Autoboxing resolves boxed longs and doubles
|
||||||
|
to `value(Number)`, but a boxed boolean would otherwise resolve to value(boolean) with an
|
||||||
|
implicit call to booleanValue() which has the potential to throw NPEs.
|
||||||
|
* Fix: Be more aggressive about canonicalizing types.
|
||||||
|
|
||||||
## Version 1.1.0
|
## Version 1.1.0
|
||||||
|
|
||||||
_2016-01-19_
|
_2016-01-19_
|
||||||
@@ -21,15 +45,15 @@ _2015-09-27_
|
|||||||
* **API Change**: Replaced `new JsonReader()` with `JsonReader.of()` and `new JsonWriter()` with
|
* **API Change**: Replaced `new JsonReader()` with `JsonReader.of()` and `new JsonWriter()` with
|
||||||
`JsonWriter.of()`. If your code calls either of these constructors it will need to be updated to
|
`JsonWriter.of()`. If your code calls either of these constructors it will need to be updated to
|
||||||
call the static factory method instead.
|
call the static factory method instead.
|
||||||
* **API Change**: Don’t throw `IOException` on `JsonAdapter.toJson(T)`. Code that calls this method
|
* **API Change**: Don’t throw `IOException` on `JsonAdapter.toJson(T)`. Code that calls this
|
||||||
may need to be fixed to no longer catch an impossible `IOException`.
|
method may need to be fixed to no longer catch an impossible `IOException`.
|
||||||
* Fix: the JSON adapter for `Object` no longer fails when encountering `null` in the stream.
|
* Fix: the JSON adapter for `Object` no longer fails when encountering `null` in the stream.
|
||||||
* New: `@Json` annotation can customize a field's name. This is particularly handy for fields whose
|
* New: `@Json` annotation can customize a field's name. This is particularly handy for fields
|
||||||
names are Java keywords, like `default` or `public`.
|
whose names are Java keywords, like `default` or `public`.
|
||||||
* New: `Rfc3339DateJsonAdapter` converts between a `java.util.Date` and a string formatted with
|
* New: `Rfc3339DateJsonAdapter` converts between a `java.util.Date` and a string formatted with
|
||||||
RFC 3339 (like `2015-09-26T18:23:50.250Z`). This class is in the new `moshi-adapters` subproject.
|
RFC 3339 (like `2015-09-26T18:23:50.250Z`). This class is in the new `moshi-adapters`
|
||||||
You will need to register this adapter if you want this date formatting behavior. See it in
|
subproject. You will need to register this adapter if you want this date formatting behavior.
|
||||||
action in the [dates example][dates_example].
|
See it in action in the [dates example][dates_example].
|
||||||
* New: `Moshi.adapter()` keeps a cache of all created adapters. For best efficiency, application
|
* New: `Moshi.adapter()` keeps a cache of all created adapters. For best efficiency, application
|
||||||
code should keep a reference to required adapters in a field.
|
code should keep a reference to required adapters in a field.
|
||||||
* New: The `Types` factory class makes it possible to compose types like `List<Card>` or
|
* New: The `Types` factory class makes it possible to compose types like `List<Card>` or
|
||||||
@@ -48,7 +72,8 @@ _2015-06-16_
|
|||||||
`JsonWriter`.
|
`JsonWriter`.
|
||||||
* Throw `JsonDataException` when there’s a data binding problem.
|
* Throw `JsonDataException` when there’s a data binding problem.
|
||||||
* Adapter methods: `@ToJson` and `@FromJson`.
|
* Adapter methods: `@ToJson` and `@FromJson`.
|
||||||
* Qualifier annotations: `@JsonQualifier` to permit different type adapters for the same Java type.
|
* Qualifier annotations: `@JsonQualifier` to permit different type adapters for the same Java
|
||||||
|
type.
|
||||||
* Imported code from Gson: `JsonReader`, `JsonWriter`. Also some internal classes:
|
* Imported code from Gson: `JsonReader`, `JsonWriter`. Also some internal classes:
|
||||||
`LinkedHashTreeMap` for hash-collision avoidance and `Types` for typesafe databinding.
|
`LinkedHashTreeMap` for hash-collision avoidance and `Types` for typesafe databinding.
|
||||||
|
|
||||||
|
@@ -455,12 +455,12 @@ Download [the latest JAR][dl] or depend via Maven:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.moshi</groupId>
|
<groupId>com.squareup.moshi</groupId>
|
||||||
<artifactId>moshi</artifactId>
|
<artifactId>moshi</artifactId>
|
||||||
<version>1.1.0</version>
|
<version>1.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
or Gradle:
|
or Gradle:
|
||||||
```groovy
|
```groovy
|
||||||
compile 'com.squareup.moshi:moshi:1.1.0'
|
compile 'com.squareup.moshi:moshi:1.2.0'
|
||||||
```
|
```
|
||||||
|
|
||||||
Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
|
Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
|
||||||
|
Reference in New Issue
Block a user