mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49:21 +08:00
Update changelog for 1.7.0.
This commit is contained in:
40
CHANGELOG.md
40
CHANGELOG.md
@@ -1,6 +1,46 @@
|
|||||||
Change Log
|
Change Log
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
## Version 1.7.0
|
||||||
|
|
||||||
|
_2018-09-24_
|
||||||
|
|
||||||
|
* New: `EnumJsonAdapter` makes it easy to specify a fallback value for unknown enum constants.
|
||||||
|
By default Moshi throws an `JsonDataException` if it reads an unknown enum constant. With this
|
||||||
|
you can specify a fallback value or null.
|
||||||
|
|
||||||
|
```java
|
||||||
|
new Moshi.Builder()
|
||||||
|
.add(EnumJsonAdapter.create(IsoCurrency.class)
|
||||||
|
.withUnknownFallback(IsoCurrency.USD))
|
||||||
|
.build();
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this adapter is in the optional `moshi-adapters` module.
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'com.squareup.moshi:moshi-adapters:1.7.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
* New: Embed R8/ProGuard rules in the `.jar` file.
|
||||||
|
* New: Use `@CheckReturnValue` in more places. We hope this will encourage you to use `skipName()`
|
||||||
|
instead of `nextName()` for better performance!
|
||||||
|
* New: Forbid automatic encoding of platform classes in `androidx`. As with `java.*`, `android.*`,
|
||||||
|
and `kotlin.*` Moshi wants you to specify how to encode platform types.
|
||||||
|
* New: Improve error reporting when creating an adapter fails.
|
||||||
|
* New: Upgrade to Okio 1.15.0. We don't yet require Kotlin-friendly Okio 2.x but Moshi works fine
|
||||||
|
with that release.
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'com.squareup.okio:okio:1.15.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
* Fix: Return false from `JsonReader.hasNext()` at document's end.
|
||||||
|
* Fix: Improve code gen to handle several broken cases. Our generated adapters had problems with
|
||||||
|
nulls, nested parameterized types, private transient properties, generic type aliases, fields
|
||||||
|
with dollar signs in their names, and named companion objects.
|
||||||
|
|
||||||
|
|
||||||
## Version 1.6.0
|
## Version 1.6.0
|
||||||
|
|
||||||
_2018-05-14_
|
_2018-05-14_
|
||||||
|
12
README.md
12
README.md
@@ -500,12 +500,12 @@ The reflection adapter requires the following additional dependency:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.moshi</groupId>
|
<groupId>com.squareup.moshi</groupId>
|
||||||
<artifactId>moshi-kotlin</artifactId>
|
<artifactId>moshi-kotlin</artifactId>
|
||||||
<version>1.6.0</version>
|
<version>1.7.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'com.squareup.moshi:moshi-kotlin:1.6.0'
|
implementation 'com.squareup.moshi:moshi-kotlin:1.7.0'
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the reflection adapter transitively depends on the `kotlin-reflect` library which is a
|
Note that the reflection adapter transitively depends on the `kotlin-reflect` library which is a
|
||||||
@@ -535,13 +535,13 @@ add the following to your build to enable the annotation processor:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.moshi</groupId>
|
<groupId>com.squareup.moshi</groupId>
|
||||||
<artifactId>moshi-kotlin-codegen</artifactId>
|
<artifactId>moshi-kotlin-codegen</artifactId>
|
||||||
<version>1.6.0</version>
|
<version>1.7.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.6.0'
|
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.7.0'
|
||||||
```
|
```
|
||||||
|
|
||||||
You must also have the `kotlin-stdlib` dependency on the classpath during compilation in order for
|
You must also have the `kotlin-stdlib` dependency on the classpath during compilation in order for
|
||||||
@@ -567,12 +567,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.6.0</version>
|
<version>1.7.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
or Gradle:
|
or Gradle:
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'com.squareup.moshi:moshi:1.6.0'
|
implementation 'com.squareup.moshi:moshi:1.7.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