ch-robinson / dotnet-avro

An Avro implementation for .NET
https://engineering.chrobinson.com/dotnet-avro/
MIT License
132 stars 49 forks source link

Add support for enums avro schema doc #290

Closed runerys closed 7 months ago

runerys commented 7 months ago

What

The Avro schema spec supports doc on enums: https://avro.apache.org/docs/1.11.1/specification/#enums

This PR uses the System.ComponentModel.DescriptionAttribute for populating the enum doc node in Avro schemas.

Why

As discussed here https://github.com/ch-robinson/dotnet-avro/issues/131 . The PR https://github.com/ch-robinson/dotnet-avro/pull/219 implements this for record schemas.

This implements the same strategy for enums.

Note We had a list of local customizations (documentation, null handling, enum default values, DateOnly, TimeOnly, NodaTime), and most of these have been fixed in the later releases. Brilliant! This PR is a contribution to get rid of one more :)