Merge pull request #673 from square/eric.property-name-hint

Use the adapter lookup hint API in the Kotlin reflection adapter.
This commit is contained in:
Jesse Wilson 2018-09-20 23:32:21 -04:00 committed by GitHub
commit 226c0c14f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,7 +229,7 @@ class KotlinJsonAdapterFactory : JsonAdapter.Factory {
val name = jsonAnnotation?.name ?: property.name
val resolvedPropertyType = resolve(type, rawType, property.returnType.javaType)
val adapter = moshi.adapter<Any>(
resolvedPropertyType, Util.jsonAnnotations(allAnnotations.toTypedArray()))
resolvedPropertyType, Util.jsonAnnotations(allAnnotations.toTypedArray()), property.name)
bindingsByName[property.name] = KotlinJsonAdapter.Binding(name, adapter,
property as KProperty1<Any, Any?>, parameter)