FluxFlow.Components.Validation 3.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluxFlow.Components.Validation --version 3.0.2
                    
NuGet\Install-Package FluxFlow.Components.Validation -Version 3.0.2
                    
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="FluxFlow.Components.Validation" Version="3.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Components.Validation" Version="3.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Components.Validation" />
                    
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 FluxFlow.Components.Validation --version 3.0.2
                    
#r "nuget: FluxFlow.Components.Validation, 3.0.2"
                    
#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 FluxFlow.Components.Validation@3.0.2
                    
#: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=FluxFlow.Components.Validation&version=3.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Components.Validation&version=3.0.2
                    
Install as a Cake Tool

FluxFlow.Components.Validation

A standalone JSON schema validator node for FluxFlow. It depends only on FluxFlow.Nodes — no engine, registry, or runtime. You new the node and LinkTo the next one.

Node

Node Shape Purpose
JsonSchemaValidatorNode<TInput> InputOutput (result), Valid, Invalid Validates a selected value with a JSON schema.

Every message travels as a FlowMessage<T> envelope. The validation result is broadcast on Output as FlowMessage<JsonSchemaValidationResult<TInput>>; the original input is fanned to Valid or Invalid (each FlowMessage<TInput>). All three carry the same correlation id as the input.

var schema = new JsonSchemaValidatorOptions
{
    Schema = JsonSerializer.SerializeToElement(new
    {
        type = "object",
        required = new[] { "id" },
        properties = new { id = new { type = "string" } }
    }),
    SchemaId = "orders"
}.LoadSchema();

await using var node = new JsonSchemaValidatorNode<JsonElement>(schema, schemaId: "orders");

node.Output.LinkTo(resultSink, new DataflowLinkOptions { PropagateCompletion = false });
node.Valid.LinkTo(validSink, new DataflowLinkOptions { PropagateCompletion = false });
node.Invalid.LinkTo(invalidSink, new DataflowLinkOptions { PropagateCompletion = false });

await node.Input.SendAsync(FlowMessage.Create(order));

JsonSchemaValidatorOptions.LoadSchema() compiles the schema once (from inline Schema or SchemaPath), so the node never performs File I/O or compilation in its pump. A missing or malformed schema throws InvalidOperationException at that point — configuration mistakes fail fast. Node construction also validates option shape before the pipeline is created: blank InputType and non-positive BoundedCapacity values fail with json.schema-validator construction errors.

Value selectors

By default the node validates the whole payload. Pass an IJsonSchemaValueSelector<TInput> to select a value from the payload (e.g. an inner property), plus a valueSelector name carried into the validation result and selector context:

var node = new JsonSchemaValidatorNode<AppMessage>(
    schema,
    selector: new PayloadSelector(),
    valueSelector: "payload");

The node accepts JsonElement, JsonDocument, JsonNode, byte[], string (parsed as JSON when possible, otherwise treated as a string value), and plain objects (serialized) as selected values.

Behavior

Invalid data is not an error: the node emits a result and routes the original input to Invalid. Value-selection, value-conversion, and schema-evaluation failures emit a FlowError on Errors (carrying the input's correlation id and a Code from ValidationErrorCodes) and the node keeps processing later messages. A one-time json.schema-validator.loaded event is emitted on construction, and per-message valid/invalid/failed events flow on the Events port.

Runtime timing

Validation results use the node's clock for Timestamp (default TimeProvider.System). Provide a deterministic clock for tests:

new JsonSchemaValidatorNode<JsonElement>(schema, clock: new FakeTimeProvider(timestamp));

Composition

The optional FluxFlow.Components.Validation.Composition package registers closed generic json.schema-validator factories for FluxFlow.Composition. The adapter binds JsonSchemaValidatorOptions, compiles inline schema or schemaPath during composition build, and resolves optional host-owned keyed IJsonSchemaValueSelector<TInput> and TimeProvider resources.

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry =>
        registry.RegisterJsonSchemaValidator<JsonElement>());

Use custom node type strings for multiple input shapes, for example json.schema-validator.order and json.schema-validator.http. InputType remains diagnostic metadata; the CLR port type comes from the closed generic registration. Invalid JsonSchemaValidatorOptions, such as blank inputType or non-positive boundedCapacity, fail during composition build and surface as factory diagnostics when build failures are configured as diagnostics. JSON schema loading and selector behavior remain owned by the validator package and the host-provided resources, not by Designer metadata.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.Validation:

Package Downloads
FluxFlow.Components.Validation.Composition

Optional FluxFlow.Composition registration and Designer metadata for explicit JsonElement JSON Schema validation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0-rc.1 69 9/5/2026
6.0.0 167 8/3/2026
3.0.2 122 7/3/2026
3.0.1 163 7/2/2026
3.0.0 122 6/19/2026
2.0.0 134 6/18/2026
1.3.0 127 6/15/2026
1.2.0 428 6/12/2026
1.1.0 113 6/5/2026
1.0.0 119 6/4/2026
0.2.0-alpha.1 233 6/2/2026
0.1.1-alpha.1 71 6/2/2026
0.1.0-alpha.1 125 6/1/2026

Adds the shared FluxFlow package icon. No source, API, or dependency changes.