You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Christiaan Biesterbosch <kr...@apache.org> on 2026/07/20 16:33:46 UTC

(Custom) attributes for unions

Hi all,

I'm running into a problem where it would be really nice to put a custom attribute on a union. For primitive types you can do:
> {
>   "type": "int",
>   "custom": 123
> }
instead of:
> "int"
to allow adding custom attributes.

But for unions doing:
> {
>   "type": ["null", "int"],
>   "custom": 123
> }
instead of:
> ["null", "int"]
results in a parse error in the Java and Python codebases but is supported in the Rust codebase (although the custom attribute is ignored there).

Is this something we should support in all codebases?

Sincerely,
Christiaan