How can I get annotations from a property? ```data...
# ksp
s
How can I get annotations from a property?
Copy code
data class Sample(
    @Json(name = "full_name") val fullName: String
)

// in KSP
KSClassDeclaration.getAllProperties().forEach {
    it.annotations // => empty list
}
I can get annotations using
getDeclaredProperties
instead of
getAllProperties
.
Copy code
KSClassDeclaration.getDeclaredProperties().forEach {
    it.annotations
}
t
Looks like a bug to me. Will fix asap. https://github.com/google/ksp/issues/310
s
I see. Thank you for your reply. 😃