Closed RyanAtWare2Go closed 3 years ago
Hi @RyanAtWare2Go. Can you have a try with the current release com.github.avro-kotlin.avro4k:avro4k-core:1.1.0? You'll also find a lot of examples of how to use AvroDefault in the corresponding test file https://github.com/avro-kotlin/avro4k/blob/master/src/test/kotlin/com/github/avrokotlin/avro4k/schema/AvroDefaultSchemaTest.kt
Let me know if using the current version fixes the problem for you.
I feel very dumb. Apparently there is an AvroDefault
provided by Apache; that was the annotation I was using. I imported the RIGHT library this time and it worked. Sorry y'all.
I am using:
implementation("com.sksamuel.avro4k", "avro4k-core", "0.30.0")
I have this class:
When I run
Avro.default.schema(AnalysisDto.serializer())
, I get:I would have thought because I was using the
@AvroDefault(Avro.NULL)
annotation that there would be a default field on status. i.e.{"name":"status", "default": null, "type":["null","string"]}
I have not been able to find any issues in the source after debugging through it for quite a while.