FixSourceGenerator 0.1.0
dotnet add package FixSourceGenerator --version 0.1.0
NuGet\Install-Package FixSourceGenerator -Version 0.1.0
<PackageReference Include="FixSourceGenerator" Version="0.1.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="FixSourceGenerator" Version="0.1.0" />
<PackageReference Include="FixSourceGenerator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add FixSourceGenerator --version 0.1.0
#r "nuget: FixSourceGenerator, 0.1.0"
#:package FixSourceGenerator@0.1.0
#addin nuget:?package=FixSourceGenerator&version=0.1.0
#tool nuget:?package=FixSourceGenerator&version=0.1.0
FIX Source Generator
A Roslyn-based source generator that converts FIX tag=value DataDictionary XML schemas (the classic QuickFIX/QuickFIX-J/QuickFIX-n format) into allocation-minimal C# reader/writer types, in the spirit of SbeSourceGenerator but for the tag=value wire format instead of Simple Binary Encoding.
See docs/CONTRACT.md for the full design contract (input schema shape,
C# output shape, type mapping, versioning, diagnostics) and docs/USAGE.md for
a getting-started guide, a worked example, and the schema-versioning guide. The tracking issue
#1 has the overall roadmap.
Design highlights
- Allocation-minimal by default. The generated API is a pair of
ref structreader/writer types overSpan<byte>/ReadOnlySpan<byte>(analogous toSystem.Text.Json.Utf8JsonReader/Utf8JsonWriter), not heap-allocated DTOs. Strings are exposed as spans by default and only materialize astringwhen the consumer explicitly asks for one. - Repeating groups without materialization, matching the same principle used by
SbeSourceGenerator: groups are exposed via
foreach-style enumerators over the underlying buffer, notList<T>. - Decode and encode. The generator emits both a reader (parses a buffer into typed field
access) and a writer (writes fields directly into a caller-supplied buffer, computing
BodyLength/CheckSumvia backpatch). - Schema-driven, zero-lookup groups. Group delimiter tags are known at compile time from the schema and embedded as constants in the generated code — no runtime dictionary lookup is needed to find group boundaries.
- Namespace-isolated versioning, so multiple FIX dictionary versions (e.g. 4.2 and 4.4) can coexist in the same consumer project.
Quick start
Reference the package and add your DataDictionary XML as an
AdditionalFilesitem:<ItemGroup> <PackageReference Include="FixSourceGenerator" Version="0.1.0" PrivateAssets="all" /> <AdditionalFiles Include="Schemas\FIX44.xml" /> </ItemGroup>Build. The generator produces a reader/writer per message in a namespace derived from your project's
RootNamespace(or theFixGeneratorNamespaceproperty) plus a version token, e.g.Acme.Fix.V44.NewOrderSingleReader/...NewOrderSingleWriter.Decode:
using Acme.Fix.V44; var reader = new NewOrderSingleReader(buffer); // ReadOnlySpan<byte> string clOrdId = Encoding.ASCII.GetString(reader.ClOrdID); decimal? price = reader.Price; // T? for optional value fields foreach (var alloc in reader.NoAllocs) // groups are enumerated, never materialized { decimal qty = alloc.AllocQty; }Encode:
Span<byte> destination = stackalloc byte[512]; var writer = new NewOrderSingleWriter(destination); writer.WriteClOrdID("ORD-1"u8); writer.WriteSide(Side.Buy); writer.WriteOrderQty(100m); int length = writer.Finish(); // backpatches BodyLength + CheckSum
See docs/USAGE.md for the full worked example (including components and
nested groups) and guidance on versioning schemas over time.
Repository layout
src/FixSourceGenerator— the Roslyn incremental source generator (netstandard2.0).Schema/— the parsed/resolved schema model (SchemaReader+FixDictionaryand friends).Generators/— codegen for readers, writers, enums, components, and the embedded runtime.Diff/—SchemaDiffer, for comparing two dictionary versions and flagging breaking changes.
tests/FixSourceGenerator.Tests— unit, generator-driver, and real-schema conformance tests.docs/CONTRACT.md— the normative design contract for input schema and generated output.docs/USAGE.md— getting-started guide, worked example, and schema-versioning guide.CHANGELOG.md— release history.
License
MIT — see LICENSE.txt.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 77 | 8/27/2026 |