@thake I didn't know the easiest way to get this in front of you, but extending on our work there appears to be an important edgecase that isn't covered. Try running PolymorphicClassSchemaTest in this branch.
For some reason it's not capturing the kClass inside of the descriptor for SealedChildTwo - but I have no idea why:
Contextual or default serializer not found for kotlinx.serialization.Sealed<SealedChildTwo>(com.github.avrokotlin.avro4k.schema.UnsealedChildTwo: com.github.avrokotlin.avro4k.schema.UnsealedChildTwo)
java.lang.IllegalArgumentException: Contextual or default serializer not found for kotlinx.serialization.Sealed<SealedChildTwo>(com.github.avrokotlin.avro4k.schema.UnsealedChildTwo: com.github.avrokotlin.avro4k.schema.UnsealedChildTwo)
at com.github.avrokotlin.avro4k.schema.SchemaForKt.schemaFor(SchemaFor.kt:189)
at com.github.avrokotlin.avro4k.schema.ClassSchemaFor.buildField(ClassSchemaFor.kt:78)
at com.github.avrokotlin.avro4k.schema.ClassSchemaFor.dataClassSchema(ClassSchemaFor.kt:63)
at com.github.avrokotlin.avro4k.schema.ClassSchemaFor.schema(ClassSchemaFor.kt:43)
at com.github.avrokotlin.avro4k.schema.UnionSchemaFor.schema(UnionSchemaFor.kt:19)
at com.github.avrokotlin.avro4k.Avro.schema(Avro.kt:264)
at com.github.avrokotlin.avro4k.Avro.schema(Avro.kt:269)
at com.github.avrokotlin.avro4k.schema.PolymorphicClassSchemaTest$1$1.invokeSuspend(PolymorphicClassSchemaTest.kt:38)
@thake I didn't know the easiest way to get this in front of you, but extending on our work there appears to be an important edgecase that isn't covered. Try running
PolymorphicClassSchemaTest
in this branch.For some reason it's not capturing the kClass inside of the descriptor for
SealedChildTwo
- but I have no idea why: