mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 07:59:21 +08:00
Update KotlinPoet to 1.3.0 (#915)
* Update to KotlinPoet 1.3.0 * Add hotwords test case * Use %N for toJson parameter names to ensure escaping
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup</groupId>
|
||||
<artifactId>kotlinpoet</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ltgt.gradle.incap</groupId>
|
||||
|
@@ -332,7 +332,7 @@ internal class AdapterGenerator(
|
||||
result.addStatement("%N.beginObject()", writerParam)
|
||||
nonTransientProperties.forEach { property ->
|
||||
result.addStatement("%N.name(%S)", writerParam, property.jsonName)
|
||||
result.addStatement("%N.toJson(%N, %N.%L)",
|
||||
result.addStatement("%N.toJson(%N, %N.%N)",
|
||||
nameAllocator[property.delegateKey], writerParam, valueParam, property.name)
|
||||
}
|
||||
result.addStatement("%N.endObject()", writerParam)
|
||||
|
@@ -1223,5 +1223,11 @@ data class SmokeTestType(
|
||||
val genericAlias: GenericTypeAlias = listOf("Woah")
|
||||
)
|
||||
|
||||
// Compile only, regression test for https://github.com/square/moshi/issues/848
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Hotwords(
|
||||
val `class`: List<String>?
|
||||
)
|
||||
|
||||
typealias TypeAliasName = String
|
||||
typealias GenericTypeAlias = List<String>
|
||||
|
Reference in New Issue
Block a user