Open zhoekstra opened 5 years ago
Currently avrohugger generates records and enums as top-level definitions, but doesn't yet support fixed types, nor type aliases. Those sound useful to add eventually, or I'd be open to reviewing a PR, but my queue is pretty full these days, so the features are likely a ways off.
Our company has a set of defined avro schemas which we're trying to use avrohugger on.
In these avro schemas, they have defined a top-level schema for fixed decimals:
This type is then referenced throughout other avro schemas like so:
This allows us to define one fixed standard for decimal precision and scale across multiple records as we build our library of company known types.
Unfortunately, avrohugger does not yet have support for top level types. I'm not sure how to best represent that, but my guess right now would be to define them as a scala type - ie if avrohugger sees the top level avro schema above, it would generate something like the following: