ch-robinson / dotnet-avro

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

implement `DefaultValue` for enums in the schema builder #289

Closed jonasby closed 10 months ago

jonasby commented 10 months ago

I use the CLI command create and noticed that it was missing support for DefaultValue on enums, which is otherwise supported in your serialization code.

I have added it in the simple way that works for my use case (resulting in output like "type":{"name":"SomeEnum","default":"First","type":"enum","symbols":["First","Second","Third"]}).

It's unclear to me whether the additional branches of the if-else in EnumSchemaBuilderCase should be extended with the default feature.

dstelljes commented 10 months ago

Thanks again @jonasby! 10.1.0 should be available on NuGet shortly

jonasby commented 10 months ago

Thanks again @jonasby! 10.1.0 should be available on NuGet shortly

Thanks to you for the helpful tools and speedy attention!