-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Import statements" go after class declaration #83
Comments
@sisel Hi, You can achieve your goal by this settings: Then you could generate class like this data class Test(
@JvmField
val a: Int,
@JvmField
val b: Int
) from JSON: {
"a": 213,
"b": 32
} |
Thanks. import is after class 😳 {
"a": 213,
"b": 32
} result: class Test(
@SerializedName("a")
@JvmField
val a: Int, // 213
@SerializedName("b")
@JvmField
val b: Int // 32
)
import com.google.gson.annotations.SerializedName plugin version 2.3.0 |
@sisel What? Unbelievable! I just test all works well import com.google.gson.annotations.SerializedName
data class TTT(
@SerializedName("a")
@JvmField
val a: Int, // 213
@SerializedName("b")
@JvmField
val b: Int // 32
) Can you provide your config setting? and in which way to generate your classes, |
Sorry, I don't know why. Thanks for your support, and I will upload more info if it happens again. |
@sisel OK, Let's keep this issue opening for one week |
Reproduced! When package name end with I have tested it with |
and generated code: package com.demo.data class Test(
@SerializedName("a")
@JvmField
val a: Int, // 213
@SerializedName("b")
@JvmField
val b: Int // 32
)
import com.google.gson.annotations.SerializedName
|
That's wired, I can't reproduce, here are the settings: And the generated class: Is there any different between our settings? @sisel And can you reproduce this? @wuseal |
@sisel @kezhenxu94 Yes. I reproduced it, too. package test.datadata class TestData(
@SerializedName("a")
@JvmField
val a: Int, // 213
@SerializedName("a")
@JvmField
val b: Int // 32
)
import com.google.gson.annotations.SerializedName Just insert code after the end of the package declaration line without changing line |
eg:
The text was updated successfully, but these errors were encountered: