Closed rafalg closed 2 months ago
Hello, It's a good question. In fact, we should not use reflection since the core of using kotlinx serialization is to not have reflection. This line is about a tricks that unwrap a nullable field serializer to maybe get an internal avro serializer.
We are currently re thinking about the schema generation by fully using kotlinx serialization features.
It won't be that quick, so the quick answer is yes, and let's see in the future to not have reflection anymore.
Still using reflection with AvroSchema
and AvroLogicalType
. Waiting for the next kotlinx-serialization release that will include this PR to allow accessing the descriptor without reflection: https://github.com/Kotlin/kotlinx.serialization/pull/2633
Duplicate of #199
Hi,
Trying to run my app as an native image. However get this issue:
java.lang.NoSuchFieldException: original at java.base@17.0.5/java.lang.Class.getDeclaredField(DynamicHub.java:961) at com.github.avrokotlin.avro4k.schema.SchemaForKt.schemaFor(SchemaFor.kt:170)
Is it a must for avro4k to use reflection?