Currently, annotating classes is totally open to mistakes, while they are just silently ignored when not appliable.
Let's take the following example. We can annotate a field with AvroFixed even if its type is a record. This can generate a schema, but it won't be able of encoding or decoding anything.
Similar examples with:
AvroDecimalLogicalType: how to apply a decimal logical type on a record ?
AvroNamespaceOverride: how to apply a namespace on a primitive type ?
maybe some others
The idea is to have some validation during schema generation (and maybe in decode/encode, but thinking about perf...) to fail when the user put weird annotations together.
Currently, annotating classes is totally open to mistakes, while they are just silently ignored when not appliable.
Let's take the following example. We can annotate a field with
AvroFixed
even if its type is a record. This can generate a schema, but it won't be able of encoding or decoding anything.Similar examples with:
AvroDecimalLogicalType
: how to apply a decimal logical type on a record ?AvroNamespaceOverride
: how to apply a namespace on a primitive type ?The idea is to have some validation during schema generation (and maybe in decode/encode, but thinking about perf...) to fail when the user put weird annotations together.