FixPortal.FixAtdl.Contracts 1.4.0

dotnet add package FixPortal.FixAtdl.Contracts --version 1.4.0
                    
NuGet\Install-Package FixPortal.FixAtdl.Contracts -Version 1.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FixPortal.FixAtdl.Contracts" Version="1.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FixPortal.FixAtdl.Contracts" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="FixPortal.FixAtdl.Contracts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FixPortal.FixAtdl.Contracts --version 1.4.0
                    
#r "nuget: FixPortal.FixAtdl.Contracts, 1.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FixPortal.FixAtdl.Contracts@1.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FixPortal.FixAtdl.Contracts&version=1.4.0
                    
Install as a Cake Addin
#tool nuget:?package=FixPortal.FixAtdl.Contracts&version=1.4.0
                    
Install as a Cake Tool

FixPortal.FixAtdl.Contracts

The JSON contract consumed by @fix-portal/fixatdl-react, produced from a FIXatdl document parsed by FixPortal.FixAtdl.

It contains:

  • the DTO records the React package renders (AtdlStrategiesDto, AtdlStrategyDto, AtdlParameterDto, AtdlPanelDto, AtdlControlDto, StateRuleAstNodeDto, ...);
  • AtdlDtoMapper, which maps a parsed Strategies_t to those records, including each control's state rules as an AST;
  • StateRuleEvaluator, which evaluates the same AST server-side, so a host can apply the rules the form applied;
  • AtdlContractJson.Options, the serializer settings the React package expects (camelCase, null members omitted).

Usage

dotnet add package FixPortal.FixAtdl.Contracts
using System.Text.Json;
using FixPortal.FixAtdl.Contracts;
using FixPortal.FixAtdl.Xml;

using var stream = File.OpenRead("strategies.xml");
var strategies = new StrategiesReader().Load(stream);

AtdlStrategiesDto contract = new AtdlDtoMapper().Map(strategies);
string json = JsonSerializer.Serialize(contract, AtdlContractJson.Options);

Serve json to the browser and pass a strategy from it to the React form.

Map takes an optional IReadOnlyDictionary<string, string> of source XML per strategy name, which populates each strategy's sourceXml. Without it, sourceXml is an empty string; the form does not need it.

Mapping throws AtdlParseException for a document whose state rules cannot be built (an unresolved EditRef, an unknown operator, an invalid literal, a strategy edit with neither Edit nor EditRef, or nesting deeper than the supported limit). Code carries a machine-readable reason from AtdlParseExceptionCode.

A compare against a non-numeric FIX_ field carries comparisonType String_t, so a zero-padded identifier is not compared as a number. A numeric FIX_ field omits comparisonType and still compares as a number. A compare between a Boolean_t parameter and another field carries trueWireValue and falseWireValue (default Y and N); StateRuleEvaluator matches those tokens with an ordinal comparison. AND and OR return as soon as the result is known. The corpus cases and_short_circuit_skips_invalid_data_operand and or_short_circuit_skips_invalid_data_operand pin that result for C#. The React evaluator does not yet.

State-rule corpus

The evaluator is held to the shared corpus contracts/state-rule-cases.json, the same cases the React package's TypeScript evaluator runs against.

Licence

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.4.0 0 10/7/2026
1.3.1 0 10/7/2026
1.3.0 39 10/6/2026