Update changelog for 1.7.0.

This commit is contained in:
Jesse Wilson
2018-09-24 22:26:55 -04:00
parent 73ca7765c0
commit efd324b82f
2 changed files with 46 additions and 6 deletions

View File

@@ -1,6 +1,46 @@
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
_2018-05-14_

View File

@@ -500,12 +500,12 @@ The reflection adapter requires the following additional dependency:
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi-kotlin</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
</dependency>
```
```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
@@ -535,13 +535,13 @@ add the following to your build to enable the annotation processor:
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi-kotlin-codegen</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
<scope>provided</scope>
</dependency>
```
```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
@@ -567,12 +567,12 @@ Download [the latest JAR][dl] or depend via Maven:
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
</dependency>
```
or Gradle:
```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].