SpanFlow.Mapping.Engine
1.0.0
See the version list below for details.
dotnet add package SpanFlow.Mapping.Engine --version 1.0.0
NuGet\Install-Package SpanFlow.Mapping.Engine -Version 1.0.0
<PackageReference Include="SpanFlow.Mapping.Engine" Version="1.0.0" />
<PackageVersion Include="SpanFlow.Mapping.Engine" Version="1.0.0" />
<PackageReference Include="SpanFlow.Mapping.Engine" />
paket add SpanFlow.Mapping.Engine --version 1.0.0
#r "nuget: SpanFlow.Mapping.Engine, 1.0.0"
#:package SpanFlow.Mapping.Engine@1.0.0
#addin nuget:?package=SpanFlow.Mapping.Engine&version=1.0.0
#tool nuget:?package=SpanFlow.Mapping.Engine&version=1.0.0
SpanFlow Mapping
Turn one shape of JSON into another with a declarative mapping definition: paths, functions, conditions, grouping, joins and aggregates. It runs in-process with no server, and it is the engine behind SpanFlow's transform node and visual mapping designer.
| Package | What it holds |
|---|---|
SpanFlow.Mapping.Core |
The mapping definition model and its validator |
SpanFlow.Mapping.Engine |
MappingEngine, which runs a definition over JSON input |
Targets .NET 8, 9 and 10, plus .NET Standard 2.0 (which includes .NET Framework 4.6.2+).
Example
using System.Text.Json;
using System.Text.Json.Nodes;
using SpanFlow.Mapping.Core.Models;
using SpanFlow.Mapping.Engine;
var mapping = JsonSerializer.Deserialize<MappingDefinition>("""
{
"target": {
"type": "object",
"mappings": [
{ "target": "profile.fullName",
"transform": { "function": "concat", "args": [ "input.user.firstName", "' '", "input.user.lastName" ] } },
{ "target": "summary.completedAmount",
"aggregate": { "function": "sum", "from": "input.orders[]",
"where": { "field": "status", "op": "eq", "value": "Completed" }, "select": "amount" } }
]
}
}
""", new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!;
var input = JsonNode.Parse("""
{ "user": { "firstName": "Ada", "lastName": "Lovelace" },
"orders": [ { "status": "Completed", "amount": 100 }, { "status": "Pending", "amount": 50 } ] }
""");
JsonNode output = new MappingEngine().Execute(mapping, input);
// {"profile":{"fullName":"Ada Lovelace"},"summary":{"completedAmount":100}}
Notes for .NET Framework / .NET Standard 2.0
- IANA time zone ids (
Asia/Karachi) and Windows ids both work on every target; on .NET Standard 2.0 they are resolved through the TimeZoneConverter package. - .NET Framework's
double.Parseis not correctly rounded, so a few extreme values (such as1e300) can come back one unit in the last place off from what .NET 8+ produces. Integers and decimals are unaffected.
Licence
MIT. These two libraries are MIT-licensed; the rest of SpanFlow is published under FSL-1.1-ALv2.
| 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 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- SpanFlow.Mapping.Core (>= 1.0.0)
- System.Text.Json (>= 10.0.1)
- TimeZoneConverter (>= 8.0.1)
-
net10.0
- SpanFlow.Mapping.Core (>= 1.0.0)
-
net8.0
- SpanFlow.Mapping.Core (>= 1.0.0)
-
net9.0
- SpanFlow.Mapping.Core (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SpanFlow.Mapping.Engine:
| Package | Downloads |
|---|---|
|
SpanFlow.Mapping.Formats
Reads and writes the wire formats around a SpanFlow mapping: the raw input is decoded into JSON, the mapping engine runs unchanged, and the result is encoded into the output format. MappingRunner does all three. |
GitHub repositories
This package is not used by any popular GitHub repositories.