Moshi in 2 parts

Moshi has APIs for reading JSON off a BufferedSource and writing JSON to a BufferedSink and has a second set of APIs for mapping JSON to Java types.

JsonReader and JsonWriter are the former, the streaming APIs. Moshi, JsonAdapter, and the Types factory methods are the latter, the object-mapping APIs.

Moshi’s Java object-mapping APIs are built on top of the streaming APIs. In fact, one could almost build an object-mapping API for another JVM (or perhaps even non-JVM soon) language on top of Moshi’s public streaming APIs. There is an exception.

Moshi’s built-in adapter for maps uses an unexposed part of the streaming API. The map adapter tells readers and writers to treat JSON values as JSON keys. This allows any JsonAdapter to be used for JSON keys, so the map adapter can handle maps with non-string key types. Note that the JsonAdapter used for map keys must serialize the key type to a string or number, so the value can be converted to a string for the JSON object’s key.

Other than this case, Moshi is two libraries.