CsAvroGen 1.1.0.1
Bug: Type boolean was not supported anymore, fixed in new version
Chg: Removed ',' when closing ']' is detected to be more java standard conform
See the version list below for details.
dotnet tool install --global CsAvroGen --version 1.1.0.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local CsAvroGen --version 1.1.0.1
#tool dotnet:?package=CsAvroGen&version=1.1.0.1
nuke :add-package CsAvroGen --version 1.1.0.1
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:
- You provide an assembly with type to be inspected. This is for cases you don't get source code of a type
- 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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
This package has no dependencies.