From 88ec00bcf4ff9625905a6f94797d8a83ae991143 Mon Sep 17 00:00:00 2001 From: Eric Cochran Date: Sun, 29 Oct 2017 05:38:48 +0000 Subject: [PATCH] Document adding the KotlinJsonAdapterFactory. If you add a custom Kotlin JsonAdapter factory after the KotlinJsonAdapterFactory, you're going to have a bad time. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 189be58..7dbcc10 100644 --- a/README.md +++ b/README.md @@ -474,9 +474,10 @@ public final class BlackjackHand { ### Kotlin Support -Kotlin classes work with Moshi out of the box, with the exception of annotations. If you need to annotate your Kotlin classes with an `@Json` annotation or otherwise, you will need to use the `moshi-kotlin` artifact, and set up Moshi to use its converter factory: +Kotlin classes work with Moshi out of the box, with the exception of annotations. If you need to annotate your Kotlin classes with an `@Json` annotation or otherwise, you will need to use the `moshi-kotlin` artifact, and set up Moshi to use its converter factory. Add the KotlinJsonAdapterFactory last to allow other installed Kotlin type factories to be used, since factories are called in order. ```kotlin val moshi = Moshi.Builder() + // Add any other JsonAdapter factories. .add(KotlinJsonAdapterFactory()) .build() ```