mardi 12 janvier 2021

Jackson annotation not visible via Kotlin Reflect

For some reason Kotlin Reflect does see my custom annotation on member property but doesn't see Jackson one. Though Jackson annotation is detected and used by Jackson itself. Minimum snippet (run in REPL thus Line_5$A classname):

annotation class A
 
 class C {
     @A
     @com.fasterxml.jackson.annotation.JsonProperty
     var x: Int = 0
 }
 
 C::class.memberProperties.forEach { println(it.annotations.map{it.annotationClass}) }

Output: [class Line_5$A]

Expected: [class Line_5$A, class com.fasterxml.jackson.annotation.JsonProperty]

How could I have access to Jackson annotation here?





Aucun commentaire:

Enregistrer un commentaire