CsAvroGen 1.2.0.1

AVRO schema generation tool for C#.
Just provide a simple C# POCO as textfile and generate any complex AVRO schema, e. g. for usage with APACHE KAFKA. Easy to use and full featured schema generator.

dotnet tool install --global CsAvroGen --version 1.2.0.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local CsAvroGen --version 1.2.0.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CsAvroGen&version=1.2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CsAvroGen

Generate AVRO schema file from an ordinary POCO

For quick readers:

Generate code from a given assemby/type combination:

csavrogen.exe -an <your_assembly>.dll -tn <your_typename> -o "<output_dir>"

Read file(s), compile it and process type:

-f <your_source_file> -tn <your_typename> -o "<output_dir>"

Get help: -h

Get version info: -v

Using this geneator you have two ways:

  1. You provide an assembly with type to be inspected. This is for cases you don't get source code of a type
  2. You provide a textfile with source code - yeah, you read that right. The source code file(s) will be compiled on the fly and afterwards the generation of AVRO schema will be done. This makes it very easy to test until you get a result that matches your expectations.

Here is a partial example (please find whole example in package):

<pre><code>

// Main template file for AVRO schema generation
//
// Include other files to get the complete source code
// You can either define al in one file or split it to an arbitrary count of files
//
//@meta::include ".\Subclass.txt"
//@meta::include ".\SubSubclass.txt"
//@meta::include ".\ImportantEnum.txt"

using System.Collections.Generic;
using CsAvroGen.DomainModel.AvroAttributes;

namespace holonsoft.CsAvroGen.SelfTestData
{
[AvroNamespace("ns.created.by.attribute")]
[AvroDoc("Test class composition for AVRO generation")]
public class SelfTestingFromText
{
[AvroDoc("Field can be null, so we get a AVRO UNION")]
public int? NullableIntField;

      [AvroDoc("This field has a default value")]
      [AvroDefaultValue(5)]
      public int IntField;

</code></pre>

As you can see, you can split source code files and use the //meta::include tag at the beginning of a line to include more files

Fields are controlled by decorating them with attributes.

All important types are supported within this release, but there is still some more work for the next release:

Roadmap - coming soon functionality:

  • Add support for logical types

  • Add support for ALIAS tag

  • Add support for sort order of records

  • Add translation support

Hope you find this generator helpful for your work.

CsAvroGen

Generate AVRO schema file from an ordinary POCO

For quick readers:

Generate code from a given assemby/type combination:

csavrogen.exe -an <your_assembly>.dll -tn <your_typename> -o "<output_dir>"

Read file(s), compile it and process type:

-f <your_source_file> -tn <your_typename> -o "<output_dir>"

Get help: -h

Get version info: -v

Using this geneator you have two ways:

  1. You provide an assembly with type to be inspected. This is for cases you don't get source code of a type
  2. You provide a textfile with source code - yeah, you read that right. The source code file(s) will be compiled on the fly and afterwards the generation of AVRO schema will be done. This makes it very easy to test until you get a result that matches your expectations.

Here is a partial example (please find whole example in package):

<pre><code>

// Main template file for AVRO schema generation
//
// Include other files to get the complete source code
// You can either define al in one file or split it to an arbitrary count of files
//
//@meta::include ".\Subclass.txt"
//@meta::include ".\SubSubclass.txt"
//@meta::include ".\ImportantEnum.txt"

using System.Collections.Generic;
using CsAvroGen.DomainModel.AvroAttributes;

namespace holonsoft.CsAvroGen.SelfTestData
{
[AvroNamespace("ns.created.by.attribute")]
[AvroDoc("Test class composition for AVRO generation")]
public class SelfTestingFromText
{
[AvroDoc("Field can be null, so we get a AVRO UNION")]
public int? NullableIntField;

      [AvroDoc("This field has a default value")]
      [AvroDefaultValue(5)]
      public int IntField;

</code></pre>

As you can see, you can split source code files and use the //meta::include tag at the beginning of a line to include more files

Fields are controlled by decorating them with attributes.

All important types are supported within this release, but there is still some more work for the next release:

Roadmap - coming soon functionality:

  • Add support for logical types

  • Add support for ALIAS tag

  • Add support for sort order of records

  • Add translation support

Hope you find this generator helpful for your work.

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.2.0.1 285 4/22/2020
1.1.0.1 347 4/13/2020