Files
moshi/adapters
Zac Sweers 954ca46b9e Add @Json.ignore (#1417)
* Default Json.name to an unset value

* Promote shared transient tests to DualKotlinTest

* Add new ignore property to Json

* Support it in ClassJsonAdapter

* Mention no enum/record support

* Support in KotlinJsonAdapter

* Rework code gen API to know of "ignored"

* Support in apt code gen

* Support in KSP

* Update old non-working transient example test

* Synthetic holders

* Use field on both
2021-11-08 11:16:57 -05:00
..
2021-08-23 17:09:59 -04:00
2021-11-08 11:16:57 -05:00
2021-08-23 17:09:59 -04:00
2020-08-27 16:50:28 -04:00

Adapters

Prebuilt Moshi JsonAdapters for various things, such as Rfc3339DateJsonAdapter for parsing java.util.Dates

To use, supply an instance of your desired converter when building your Moshi instance.

Moshi moshi = new Moshi.Builder()
    .add(Date.class, new Rfc3339DateJsonAdapter())
    //etc
    .build();

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.squareup.moshi</groupId>
  <artifactId>moshi-adapters</artifactId>
  <version>latest.version</version>
</dependency>

or Gradle:

implementation 'com.squareup.moshi:moshi-adapters:latest.version'

Snapshots of the development version are available in Sonatype's snapshots repository.