After calling the dotnet avro generate < example-class.avsc > ExampleClass.cs command, the namespace in the C# class matches the namespace defined in the schema (Avro.Namespace), so I need to rename it manually to fit the rest of C# code. Is it possible to add some parameter to dotnet avro generate command to specify a custom namespace?
For example, the avrogen tool provides similar parameter:
--namespace - Map an Avro schema/protocol namespace to a C# namespace. The format is "my.avro.namespace:my.csharp.namespace". May be specified multiple times to map multiple namespaces.
Let's assume we have the following AVRO schema
example-class.avsc
:{ "name": "Name", "namespace": "Avro.Namespace", "type": "record", "doc": "...", "fields": [ { "doc": "Description", "name": "some_field", "type": "string" } ] }
After calling the
dotnet avro generate < example-class.avsc > ExampleClass.cs
command, the namespace in the C# class matches the namespace defined in the schema (Avro.Namespace
), so I need to rename it manually to fit the rest of C# code. Is it possible to add some parameter todotnet avro generate
command to specify a custom namespace?For example, the
avrogen
tool provides similar parameter:--namespace - Map an Avro schema/protocol namespace to a C# namespace. The format is "my.avro.namespace:my.csharp.namespace". May be specified multiple times to map multiple namespaces.