1Change Log 2========== 3 4## Version 1.13.0 5 6_2021-12-08_ 7 8 * New: Support for [Kotlin Symbol Processing (KSP)][ksp]. KSP is an alternative to annotation 9 processing code gen. It's builds faster and better supports Kotlin language features. 10 11 To use KSP in your application you must enable the KSP Gradle plugin and add a KSP dependency 12 on Moshi codegen. 13 14 ``` 15 plugins { 16 id("com.google.devtools.ksp").version("1.6.0-1.0.1") 17 } 18 19 dependencies { 20 ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0") 21 } 22 ``` 23 24 If you're switching from annotation processing (kapt) to KSP, you should remove the kapt plugin 25 and the kapt Moshi dependency. 26 27 * New: `@Json(ignore = true)` is a Moshi-specific way to exclude properties from JSON encoding 28 and decoding. 29 * New: Support Java 16 records. (Moshi still requires Java 8 only; we're shipping a [multi-release 30 jar][mrjar] to better support modern JVMs.) 31 * New: Option to disable generating R8/ProGuard files. These files prevent code shrinkers from 32 removing files that support JSON processing. If you're not using ProGuard or R8, you can skip 33 this step. 34 35 ``` 36 ksp { 37 arg("moshi.generateProguardRules", "false") 38 } 39 ``` 40 41 * Upgrade: [Kotlin 1.6.0][kotlin_1_6_0]. 42 43## Version 1.12.0 44 45_2021-04-01_ 46 47 * New: Improve generated code performance when all properties are set. 48 * Fix: Don't crash on a missing type element like `@SuppressLint`. 49 * Fix: Update the JVM metadata library to avoid problems on Kotlin 1.5.0-M2. 50 * Fix: Support generic arrays with defaults in generated adapters. 51 * Fix: Don't generate code with simple name collisions. 52 * Upgrade: [Okio 2.10.0][okio_2_10_0]. 53 * Upgrade: [Kotlin 1.4.31][kotlin_1_4_31]. 54 55## Version 1.11.0 56 57_2020-10-04_ 58 59 * New: Kotlin extension functions and properties. Use of these extensions is only possible from 60 Kotlin, and requires the Kotlin stdlib dependency. This release does not have any Kotlin 61 requirement and can be used Kotlin-free from Java. 62 63 ```kotlin 64 /** Extension alternative to [Types.nextAnnotations()]. */ 65 fun <reified T : Annotation> Set<Annotation>.nextAnnotations(): Set<Annotation>? 66 67 /** Extension alternative to [Types.getRawType()]. */ 68 val Type.rawType: Class<*> 69 70 /** Extension alternative to [Types.arrayOf()]. */ 71 fun KClass<*>.asArrayType(): GenericArrayType 72 73 /** Extension alternative to [Types.arrayOf()]. */ 74 fun Type.asArrayType(): GenericArrayType 75 ``` 76 77 * New: Experimental Kotlin extensions. These depend on unreleased APIs and may break in a future 78 release of Kotlin. If you are comfortable with this, add `@ExperimentalStdlibApi` at the callsite 79 or add this argument to your Kotlin compiler: `"-Xopt-in=kotlin.ExperimentalStdlibApi"`. 80 81 ```kotlin 82 /** Returns the adapter for [T]. */ 83 inline fun <reified T> Moshi.adapter(): JsonAdapter<T> 84 85 /** Returns the adapter for [ktype]. */ 86 fun <T> Moshi.adapter(ktype: KType): JsonAdapter<T> 87 88 /** Adds an adapter for [T]. */ 89 inline fun <reified T> Moshi.Builder.addAdapter(adapter: JsonAdapter<T>): Moshi.Builder 90 91 /** Extension alternative to [Types.arrayOf()]. */ 92 fun KType.asArrayType(): GenericArrayType 93 94 /** Extension alternative to [Types.subtypeOf()]. */ 95 inline fun <reified T> subtypeOf(): WildcardType 96 97 /** Extension alternative to [Types.supertypeOf()]. */ 98 inline fun <reified T> supertypeOf(): WildcardType 99 ``` 100 101 * New: `JsonReader.nextSource()`. This returns an Okio `BufferedSource` that streams the UTF-8 102 bytes of a JSON value. Use this to accept JSON values without decoding them, to delegate to 103 another JSON processor, or for streaming access to very large embedded values. 104 * New: `Moshi.Builder.addLast()`. Use this when installing widely-applicable adapter factories like 105 `KotlinJsonAdapterFactory`. Adapters registered with `add()` are preferred (in the order they 106 were added), followed by all adapters registered with `addLast()` (also in the order they were 107 added). This precedence is retained when `Moshi.newBuilder()` is used. 108 * New: `setTag()`, `tag()` methods on `JsonReader` and `JsonWriter`. Use these as a side-channel 109 between adapters and their uses. For example, a tag may be used to track use of unexpected 110 data in a custom adapter. 111 * Fix: Don't crash with a `StackOverflowError` decoding backward-referencing type variables in 112 Kotlin. This caused problems for parameterized types like `MyInterface<E : Enum<E>>`. 113 * Upgrade: [Okio 1.17.5][okio_1_7_5]. 114 * Upgrade: [Kotlin 1.4.10][kotlin_1_4_10]. 115 116## Version 1.10.0 117 118_2020-08-26_ 119 120 * New: Upgrade to Kotlin 1.4.0. 121 * New: `JsonReader.promoteNameToValue()` makes it easier to build custom `Map` adapters. 122 * New: `Options.strings()`. 123 * New: `PolymorphicJsonAdapterFactory.withFallbackJsonAdapter()` makes it possible to handle 124 unrecognized types when encoding and decoding. 125 * New: Add `JsonWriter.jsonValue` API 126 * New: Code gen now generates precise proguard rules on-the-fly. 127 * New: Improve error when incorrectly trying to use a collection class like `ArrayList` instead of `List` 128 * Fix: Prevent R8 from keeping all `@Metadata` annotations 129 * Fix: Avoid VerifyErrors on Android 4.4 devices when using R8 130 * Fix: Fix resolution of types in superclass settable properties 131 132## Version 1.9.3 133 134_2020-06-11_ 135 136 * Fix: Tweak a shrinker rule to mitigate an R8 bug which was causing classes unrelated to the Kotlin adpater code generation to be retained. 137 * Fix: Ensure that the Kotlin adapter code generation does not line wrap in the middle of a string if your JSON keys contain spaces. 138 * Fix: Strip type annotations before emitting type references like `Foo::class` in the Kotlin adapter code generation. 139 * Fix: Separate the runtime check for Kotlin's `DefaultConstructorMarker` from the check for `Metadata`. A shrinker may have removed `Metadata` and we should still check for `DefaultConstructorMarker`. 140 141 142## Version 1.9.2 143 144_2019-11-17_ 145 146 * Fix: Generate correct adapters for several special cases including reified inline types, public 147 classes enclosed in internal classes, deprecated types with `-Werror`, primitives in type 148 parameters, nullables in type parameters, and type aliases in type parameters. 149 150 151## Version 1.9.1 152 153_2019-10-30_ 154 155 * Fix: "abstract function ... cannot have code" code gen crash when parsing Kotlin metadata. 156 * Fix: Generate code to support constructors with more than 32 parameters. The 1.9.0 release had 157 a regression where classes with 33+ parameters would crash upon decoding. 158 * Fix: Generate code to support more constructor cases, such as classes with non-property 159 parameters and classes with multiple constructors. 160 * Fix: Generate code to handle type aliases in type parameters. 161 162 163## Version 1.9.0 164 165_2019-10-29_ 166 167 * **This release requires kotlin-reflect or moshi-kotlin-codegen for all Kotlin classes.** 168 169 Previously Moshi wouldn't differentiate between Kotlin classes and Java classes if Kotlin was 170 not configured. This caused bad runtime behavior such as putting null into non-nullable fields! 171 If you attempt to create an adapter for a Kotlin type, Moshi will throw an 172 `IllegalArgumentException`. 173 174 Fix this with either the reflection adapter: 175 176 ```kotlin 177 val moshi = Moshi.Builder() 178 // ... add your own JsonAdapters and factories ... 179 .add(KotlinJsonAdapterFactory()) 180 .build() 181 ``` 182 183 Or the codegen annotation processor: 184 185 ```kotlin 186 @JsonClass(generateAdapter = true) 187 data class BlackjackHand( 188 val hidden_card: Card, 189 val visible_cards: List<Card> 190 ) 191 ``` 192 193 The [Kotlin documentation][moshi_kotlin_docs] explains the required build configuration changes. 194 195 * New: Change how Moshi's generated adapters call constructors. Previous generated code used a 196 combination of the constructor and `copy()` method to set properties that have default values. 197 With this update we call the same synthetic constructor that Kotlin uses. This is less surprising 198 though it requires us to generate some tricky code. 199 * New: Make `Rfc3339DateJsonAdapter` null-safe. Previously Moshi would refuse to decode null dates. 200 Restore that behavior by explicitly forbidding nulls with `Rfc3339DateJsonAdapter().nonNull()`. 201 * New: Require Kotlin 1.3.50 or newer. 202 * New: `JsonWriter.valueSink()` streams JSON-formatted data inline. Use this to do basic includes 203 of raw JSON within a streamed document. 204 * New: Support Gradle incremental processing in code gen. 205 * New: Improve error messages. This includes better errors when field names and JSON names 206 disagree, and when failing on an unknown field. 207 * New: Support default values in `PolymorphicJsonAdapterFactory`. 208 * New: Permit multiple labels for each subtype in `PolymorphicJsonAdapterFactory`. The first label 209 is used when writing an object to JSON. 210 * New: Forbid automatic encoding of platform classes in `kotlinx`. As with `java.*`, `android.*`, 211 and `kotlin.*` Moshi wants you to specify how to encode platform types. 212 * New: `@JsonClass(generator=...)` makes it possible for third-party libraries to provide generated 213 adapters when Moshi's default adapters are insufficient. 214 * Fix: Simplify wildcard types like `List<? extends Number>` to their base types `List<Number>` 215 when finding type adapters. This is especially useful with Kotlin where wildcards may be added 216 automatically. 217 * Fix: Use the correct name when the `@Json` annotation uses field targeting like `@field:Json`. 218 * Fix: Support multiple transient properties in `KotlinJsonAdapter`. 219 * Fix: Don't explode attempting to resolve self-referential type variables like in 220 `Comparable<T extends Comparable<T>>`. 221 * Fix: Don't infinite loop on `skipValue()` at the end an object or array. Also disallow calling 222 `skipValue()` at the end of a document. 223 224 225## Version 1.8.0 226 227_2018-11-09_ 228 229 * New: Support JSON objects that include type information in the JSON. The new 230 `PolymorphicJsonAdapterFactory` writes a type field when encoding, and reads it when decoding. 231 * New: Fall back to the reflection-based `KotlinJsonAdapterFactory` if it is enabled and a 232 generated adapter is not found. This makes it possible to use reflection-based JSON adapters in 233 development (so you don't have to wait for code to be regenerated on every build) and generated 234 JSON adapters in production (so you don't need the kotlin-reflect library). 235 * New: The `peekJson()` method on `JsonReader` let you read ahead on a JSON stream without 236 consuming it. This builds on Okio's new `Buffer.peek()` API. 237 * New: The `beginFlatten()` and `endFlatten()` methods on `JsonWriter` suppress unwanted nesting 238 when composing adapters. Previously it was necessary to flatten objects in memory before writing. 239 * New: Upgrade to Okio 1.16.0. We don't yet require Kotlin-friendly Okio 2.1 but Moshi works fine 240 with that release. 241 242 ```kotlin 243 implementation("com.squareup.okio:okio:1.16.0") 244 ``` 245 246 * Fix: Don't return partially-constructed adapters when using a Moshi instance concurrently. 247 * Fix: Eliminate warnings and errors in generated `.kt` triggered by type variance, primitive 248 types, and required values. 249 * Fix: Improve the supplied rules (`moshi.pro`) to better retain symbols used by Moshi. We 250 recommend R8 when shrinking code. 251 * Fix: Remove code generation companion objects. This API was neither complete nor necessary. 252 253 254## Version 1.7.0 255 256_2018-09-24_ 257 258 * New: `EnumJsonAdapter` makes it easy to specify a fallback value for unknown enum constants. 259 By default Moshi throws an `JsonDataException` if it reads an unknown enum constant. With this 260 you can specify a fallback value or null. 261 262 ```java 263 new Moshi.Builder() 264 .add(EnumJsonAdapter.create(IsoCurrency.class) 265 .withUnknownFallback(IsoCurrency.USD)) 266 .build(); 267 ``` 268 269 Note that this adapter is in the optional `moshi-adapters` module. 270 271 ```groovy 272 implementation 'com.squareup.moshi:moshi-adapters:1.7.0' 273 ``` 274 275 * New: Embed R8/ProGuard rules in the `.jar` file. 276 * New: Use `@CheckReturnValue` in more places. We hope this will encourage you to use `skipName()` 277 instead of `nextName()` for better performance! 278 * New: Forbid automatic encoding of platform classes in `androidx`. As with `java.*`, `android.*`, 279 and `kotlin.*` Moshi wants you to specify how to encode platform types. 280 * New: Improve error reporting when creating an adapter fails. 281 * New: Upgrade to Okio 1.15.0. We don't yet require Kotlin-friendly Okio 2.x but Moshi works fine 282 with that release. 283 284 ```groovy 285 implementation 'com.squareup.okio:okio:1.15.0' 286 ``` 287 288 * Fix: Return false from `JsonReader.hasNext()` at document's end. 289 * Fix: Improve code gen to handle several broken cases. Our generated adapters had problems with 290 nulls, nested parameterized types, private transient properties, generic type aliases, fields 291 with dollar signs in their names, and named companion objects. 292 293 294## Version 1.6.0 295 296_2018-05-14_ 297 298 * **Moshi now supports codegen for Kotlin.** We've added a new annotation processor that generates 299 a small and fast JSON adapter for your Kotlin types. It can be used on its own or with the 300 existing `KotlinJsonAdapterFactory` adapter. 301 302 * **Moshi now resolves all type parameters.** Previously Moshi wouldn't resolve type parameters on 303 top-level classes. 304 305 * New: Support up to 255 levels of nesting when reading and writing JSON. Previously Moshi would 306 reject JSON input that contained more than 32 levels of nesting. 307 * New: Write encoded JSON to a stream with `JsonWriter.value(BufferedSource)`. Use this to emit a 308 JSON value without decoding it first. 309 * New: `JsonAdapter.nonNull()` returns a new JSON adapter that forbids explicit nulls in the JSON 310 body. Use this to detect and fail eagerly on unwanted nulls. 311 * New: `JsonReader.skipName()` is like `nextName()` but it avoids allocating when a name is 312 unknown. Use this when `JsonReader.selectName()` returns -1. 313 * New: Automatic module name of `com.squareup.moshi` for use with the Java Platform Module System. 314 This moves moshi-adapters into its own `.adapters` package and forwards the existing adapter. It 315 moves the moshi-kotlin into its own `.kotlin.reflect` package and forwards the existing adapter. 316 * New: Upgrade to Okio 1.14.0. 317 318 ```xml 319 <dependency> 320 <groupId>com.squareup.okio</groupId> 321 <artifactId>okio</artifactId> 322 <version>1.14.0</version> 323 </dependency> 324 325 com.squareup.okio:okio:1.14.0 326 ``` 327 328 * Fix: Fail fast if there are trailing non-whitespace characters in the JSON passed to 329 `JsonAdapter.fromJson(String)`. Previously such data was ignored! 330 * Fix: Fail fast when Kotlin types are abstract, inner, or object instances. 331 * Fix: Fail fast if `name()` is called out of sequence. 332 * Fix: Handle asymmetric `Type.equals()` methods when doing type comparisons. Previously it was 333 possible that a registered type adapter would not be used because its `Type.equals()` method was 334 not consistent with a user-provided type. 335 * Fix: `JsonValueReader.selectString()` now returns -1 for non-strings instead of throwing. 336 * Fix: Permit reading numbers as strings when the `JsonReader` was created from a JSON value. This 337 was always supported when reading from a stream but broken when reading from a decoded value. 338 * Fix: Delegate to user-adapters in the adapter for Object.class. Previously when Moshi encountered 339 an opaque Object it would only use the built-in adapters. With this change user-installed 340 adapters for types like `String` will always be honored. 341 342## Version 1.5.0 343 344_2017-05-14_ 345 346 * **Moshi now uses `@Nullable` to annotate all possibly-null values.** We've added a compile-time 347 dependency on the JSR 305 annotations. This is a [provided][maven_provided] dependency and does 348 not need to be included in your build configuration, `.jar` file, or `.apk`. We use 349 `@ParametersAreNonnullByDefault` and all parameters and return types are never null unless 350 explicitly annotated `@Nullable`. 351 352 * **Warning: Moshi APIs in this update are source-incompatible for Kotlin callers.** Nullability 353 was previously ambiguous and lenient but now the compiler will enforce strict null checks. 354 355 * **Kotlin models are now supported via the `moshi-kotlin` extension.** `KotlinJsonAdapterFactory` 356 is the best way to use Kotlin with Moshi. It honors default values and is null-safe. Kotlin 357 users that don't use this factory should write custom adapters for their JSON types. Otherwise 358 Moshi cannot properly initialize delegated properties of the objects it decodes. 359 360 * New: Upgrade to Okio 1.13.0. 361 362 ```xml 363 <dependency> 364 <groupId>com.squareup.okio</groupId> 365 <artifactId>okio</artifactId> 366 <version>1.13.0</version> 367 </dependency> 368 369 com.squareup.okio:okio:1.13.0 370 ``` 371 372 * New: You may now declare delegates in `@ToJson` and `@FromJson` methods. If one of the arguments 373 to the method is a `JsonAdapter` of the same type, that will be the next eligible adapter for 374 that type. This may be useful for composing adapters. 375 * New: `Types.equals(Type, Type)` makes it easier to compare types in `JsonAdapter.Factory`. 376 * Fix: Retain the sign on negative zero. 377 378 379## Version 1.4.0 380 381_2017-02-04_ 382 383Moshi 1.4 is a major release that adds _JSON values_ as a core part of the library. We consider any 384Java object comprised of maps, lists, strings, numbers, booleans and nulls to be a JSON value. These 385are equivalent to parsed JSON objects in JavaScript, [Gson][gson]’s `JsonElement`, and 386[Jackson][jackson]’s `JsonNode`. Unlike Jackson and Gson, Moshi just uses Java’s built-in types for 387its values: 388 389<table> 390<tr><th></th><th>JSON type</th><th>Java type</th></tr> 391<tr><td>{...}</td><td>Object</td><td>Map<String, Object></th></tr> 392<tr><td>[...]</td><td>Array</td><td>List<Object></th></tr> 393<tr><td>"abc"</td><td>String</td><td>String</th></tr> 394<tr><td>123</td><td>Number</td><td>Double, Long, or BigDecimal</th></tr> 395<tr><td>true</td><td>Boolean</td><td>Boolean</th></tr> 396<tr><td>null</td><td>null</td><td>null</th></tr> 397</table> 398 399Moshi's new API `JsonAdapter.toJsonValue()` converts your application classes to JSON values 400comprised of the above types. Symmetrically, `JsonAdapter.fromJsonValue()` converts JSON values to 401your application classes. 402 403 * New: `JsonAdapter.toJsonValue()` and `fromJsonValue()`. 404 * New: `JsonReader.readJsonValue()` reads a JSON value from a stream. 405 * New: `Moshi.adapter(Type, Class<? extends Annotation>)` lets you look up the adapter for a 406 qualified type. 407 * New: `JsonAdapter.serializeNulls()` and `indent()` return JSON adapters that customize the 408 format of the encoded JSON. 409 * New: `JsonReader.selectName()` and `selectString()` optimize decoding JSON with known names and 410 values. 411 * New: `Types.nextAnnotations()` reduces the amount of code required to implement a custom 412 `JsonAdapter.Factory`. 413 * Fix: Don't fail on large longs that have a fractional component like `9223372036854775806.0`. 414 415## Version 1.3.1 416 417_2016-10-21_ 418 419 * Fix: Don't incorrectly report invalid input when a slash character is escaped. When we tightened 420 our invalid escape handling we missed the one character that is valid both escaped `\/` and 421 unescaped `/`. 422 423## Version 1.3.0 424 425_2016-10-15_ 426 427 * New: Permit `@ToJson` and `@FromJson` methods to take any number of `JsonAdapter` parameters to 428 delegate to. This is supported for `@ToJson` methods that take a `JsonWriter` and `@FromJson` 429 methods that take a `JsonReader`. 430 * New: Throw `JsonEncodingException` when the incoming data is not valid JSON. Use this to 431 differentiate data format problems from connectivity problems. 432 * New: Upgrade to Okio 1.11.0. 433 434 ```xml 435 <dependency> 436 <groupId>com.squareup.okio</groupId> 437 <artifactId>okio</artifactId> 438 <version>1.11.0</version> 439 </dependency> 440 ``` 441 442 * New: Omit Kotlin (`kotlin.*`) and Scala (`scala.*`) platform types when encoding objects using 443 their fields. This should make it easier to avoid unexpected dependencies on platform versions. 444 * Fix: Explicitly limit reading and writing to 31 levels of nested structure. Previously no 445 specific limit was enforced, but deeply nested documents would fail with either an 446 `ArrayIndexOutOfBoundsException` due to a bug in `JsonWriter`'s path management, or a 447 `StackOverflowError` due to excessive recursion. 448 * Fix: Require enclosed types to specify their enclosing type with 449 `Types.newParameterizedTypeWithOwner()`. Previously this API did not exist and looking up 450 adapters for enclosed parameterized types was not possible. 451 * Fix: Fail on invalid escapes. Previously any character could be escaped. With this fix only 452 characters permitted to be escaped may be escaped. Use `JsonReader.setLenient(true)` to read 453 JSON documents that escape characters that should not be escaped. 454 455## Version 1.2.0 456 457_2016-05-28_ 458 459 * New: Take advantage of Okio's new `Options` feature when reading field names and enum values. 460 This has a significant impact on performance. We measured parsing performance improve from 89k 461 ops/sec to 140k ops/sec on one benchmark on one machine. 462 * New: Upgrade to Okio 1.8.0. 463 464 ```xml 465 <dependency> 466 <groupId>com.squareup.okio</groupId> 467 <artifactId>okio</artifactId> 468 <version>1.8.0</version> 469 </dependency> 470 ``` 471 472 * New: Support types that lack no-argument constructors objects on Android releases prior to 473 Gingerbread. 474 * Fix: Add writer value overload for boxed booleans. Autoboxing resolves boxed longs and doubles 475 to `value(Number)`, but a boxed boolean would otherwise resolve to value(boolean) with an 476 implicit call to booleanValue() which has the potential to throw NPEs. 477 * Fix: Be more aggressive about canonicalizing types. 478 479## Version 1.1.0 480 481_2016-01-19_ 482 483 * New: Support [RFC 7159][rfc_7159], the latest JSON specification. This removes the constraint 484 that the root value must be an array or an object. It may now take any value: array, object, 485 string, number, boolean, or null. Previously this was only permitted if the adapter was 486 configured to be lenient. 487 * New: Enum constants may be annotated with `@Json` to customize their encoded value. 488 * New: Create new builder from Moshi instance with `Moshi.newBuilder()`. 489 * New: `Types.getRawType()` and `Types.collectionElementType()` APIs to assist in defining generic 490 type adapter factories. 491 492## Version 1.0.0 493 494_2015-09-27_ 495 496 * **API Change**: Replaced `new JsonReader()` with `JsonReader.of()` and `new JsonWriter()` with 497 `JsonWriter.of()`. If your code calls either of these constructors it will need to be updated to 498 call the static factory method instead. 499 * **API Change**: Don’t throw `IOException` on `JsonAdapter.toJson(T)`. Code that calls this 500 method may need to be fixed to no longer catch an impossible `IOException`. 501 * Fix: the JSON adapter for `Object` no longer fails when encountering `null` in the stream. 502 * New: `@Json` annotation can customize a field's name. This is particularly handy for fields 503 whose names are Java keywords, like `default` or `public`. 504 * New: `Rfc3339DateJsonAdapter` converts between a `java.util.Date` and a string formatted with 505 RFC 3339 (like `2015-09-26T18:23:50.250Z`). This class is in the new `moshi-adapters` 506 subproject. You will need to register this adapter if you want this date formatting behavior. 507 See it in action in the [dates example][dates_example]. 508 * New: `Moshi.adapter()` keeps a cache of all created adapters. For best efficiency, application 509 code should keep a reference to required adapters in a field. 510 * New: The `Types` factory class makes it possible to compose types like `List<Card>` or 511 `Map<String, Integer>`. This is useful to look up JSON adapters for parameterized types. 512 * New: `JsonAdapter.failOnUnknown()` returns a new JSON adapter that throws if an unknown value is 513 encountered on the stream. Use this in development and debug builds to detect typos in field 514 names. This feature shouldn’t be used in production because it makes migrations very difficult. 515 516## Version 0.9.0 517 518_2015-06-16_ 519 520 * Databinding for primitive types, strings, enums, arrays, collections, and maps. 521 * Databinding for plain old Java objects. 522 * [JSONPath](http://goessner.net/articles/JsonPath/) support for both `JsonReader` and 523 `JsonWriter`. 524 * Throw `JsonDataException` when there’s a data binding problem. 525 * Adapter methods: `@ToJson` and `@FromJson`. 526 * Qualifier annotations: `@JsonQualifier` to permit different type adapters for the same Java 527 type. 528 * Imported code from Gson: `JsonReader`, `JsonWriter`. Also some internal classes: 529 `LinkedHashTreeMap` for hash-collision avoidance and `Types` for typesafe databinding. 530 531 532 [dates_example]: https://github.com/square/moshi/blob/master/examples/src/main/java/com/squareup/moshi/recipes/ReadAndWriteRfc3339Dates.java 533 [gson]: https://github.com/google/gson 534 [jackson]: http://wiki.fasterxml.com/JacksonHome 535 [kotlin_1_4_10]: https://github.com/JetBrains/kotlin/releases/tag/v1.4.10 536 [kotlin_1_4_31]: https://github.com/JetBrains/kotlin/releases/tag/v1.4.31 537 [kotlin_1_6_0]: https://github.com/JetBrains/kotlin/releases/tag/v1.6.0 538 [ksp]: https://github.com/google/ksp 539 [maven_provided]: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html 540 [moshi_kotlin_docs]: https://github.com/square/moshi/blob/master/README.md#kotlin 541 [mrjar]: https://openjdk.java.net/jeps/238 542 [okio_1_7_5]: https://square.github.io/okio/changelog/#version-1175 543 [okio_2_10_0]: https://square.github.io/okio/changelog/#version-2100 544 [rfc_7159]: https://tools.ietf.org/html/rfc7159 545