NextGenPowerToys.Json.Transform.Test 2.3.0

Suggested Alternatives

NextGenPowerToys.Json.Transform

Additional Details

wrong package name

dotnet add package NextGenPowerToys.Json.Transform.Test --version 2.3.0
                    
NuGet\Install-Package NextGenPowerToys.Json.Transform.Test -Version 2.3.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="NextGenPowerToys.Json.Transform.Test" Version="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NextGenPowerToys.Json.Transform.Test" Version="2.3.0" />
                    
Directory.Packages.props
<PackageReference Include="NextGenPowerToys.Json.Transform.Test" />
                    
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 NextGenPowerToys.Json.Transform.Test --version 2.3.0
                    
#r "nuget: NextGenPowerToys.Json.Transform.Test, 2.3.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 NextGenPowerToys.Json.Transform.Test@2.3.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=NextGenPowerToys.Json.Transform.Test&version=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=NextGenPowerToys.Json.Transform.Test&version=2.3.0
                    
Install as a Cake Tool

NextGenPowerToys.Json.Transform

⚠️ ALPHA VERSION - FOR TESTING PURPOSES ONLY ⚠️

A high-performance .NET JSON transformation engine that maps source JSON data to target JSON structures using configurable transformation templates with advanced conditional logic, string operations, and mathematical operations.

🏆 Key Highlights

36 Tests Passing - Comprehensive test coverage including string operations and conditional aggregation scenarios
High Performance - Complex transformations in under 40μs with minimal memory allocation
🎯 Advanced Features - String operations, conditional aggregation, mathematical operations, and more
Production Ready - Battle-tested with extensive benchmarks and validation

�🚀 Quick Start

using Json.Transform.Core;

var sourceJson = """
{
    "user": {
        "name": "John Doe",
        "age": 25,
        "email": "john@example.com"
    }
}
""";

var templateJson = """
{
    "mappings": [
        {
            "from": "$.user.name",
            "to": "$.customer.fullName"
        },
        {
            "from": "$.user.email",
            "to": "$.customer.contactInfo.email"
        },
        {
            "from": "$.user.age",
            "to": "$.customer.category",
            "conditions": [
                {
                    "if": "$.user.age >= 18",
                    "then": "Adult",
                    "else": "Minor"
                }
            ]
        }
    ]
}
""";

var transformer = new JsonTransformer();
var result = transformer.Transform(sourceJson, templateJson);

✨ Complete Feature Set

🔄 Core Transformation Capabilities

  • Field Mapping: JSONPath-based field copying and moving with nested object creation
  • Conditional Logic: Complex if/else/elseif conditions with multiple operators
  • Conditional Aggregation: Filter arrays before aggregation with complex boolean conditions
  • String Concatenation: Template-based string composition with dynamic values
  • String Operations: Advanced string comparison operators (contains, startsWith, endsWith)
  • Aggregation Operations: Sum, average, min, max, count, first, last, join
  • Mathematical Operations: Add, subtract, multiply, divide, power, sqrt, abs, round
  • Constants: Static values including timestamps, GUIDs, booleans
  • Nested Transformations: Deep object structure mapping with templates

🎯 String Operations

// String comparison operators in conditions
{
    "conditions": [
        {
            "if": "$.email contains 'admin' || $.email startsWith 'support'",
            "then": "Staff Member"
        },
        {
            "if": "$.email endsWith '@company.com'",
            "then": "Employee"
        },
        {
            "else": true,
            "then": "External"
        }
    ]
}

// Template concatenation
{
    "concat": "{$.title} {$.firstName} {$.lastName}"
}

📊 Conditional Aggregation

// Filter arrays before aggregation
{
    "from": "$.orders[*]",
    "to": "$.summary.highValueTotal",
    "aggregation": {
        "type": "sum",
        "field": "total",
        "condition": "$.item.total > 100 && $.item.status == 'completed'"
    }
}

🧮 Mathematical Operations

// Complex calculations
{
    "to": "$.order.total",
    "math": {
        "operation": "add",
        "operands": ["$.order.subtotal", "$.order.tax", "$.order.shipping"]
    }
}

🏗️ Multi-Condition Logic

// Complex boolean expressions
{
    "conditions": [
        {
            "if": "$.age >= 18 && $.verified == true && ($.type == 'premium' || $.score > 90)",
            "then": "Eligible"
        }
    ]
}

📦 Installation

dotnet add package NextGenPowerToys.Json.Transform --version 1.0.0-alpha

🎮 Interactive Playground

Try the live playground at: https://github.com/NextGenPowerToys/dotnet-json-transform

📚 Complete Documentation

📖 Query Templates Reference

For comprehensive transformation patterns, query expressions, and template structures, see: Query Templates Reference - Complete guide to all transformation capabilities

🔍 What's Included:

  • Template Structure: Basic template format and mapping rule structure
  • JSONPath Expressions: Path patterns and advanced expressions
  • Conditional Logic: Simple and complex boolean expressions with AND/OR operators
  • Mathematical Operations: All supported math operations with examples
  • Aggregation Operations: Basic and conditional aggregation with filtering
  • String Operations: Concatenation templates and comparison operators
  • Constant Values: Static and dynamic constants
  • Complex Transformations: Nested templates and multi-step operations
  • Advanced Patterns: Dynamic field names, array transformations, error handling
  • Performance Optimization: Best practices for efficient transformations
  • Common Use Cases: E-commerce, user profiles, analytics aggregation

🌐 Online Resources

⚡ Performance

  • Execution Speed: Complex transformations complete in under 40μs
  • Memory Efficiency: Minimal allocations with proper disposal
  • High Throughput: Optimized for batch processing scenarios
  • Scalable: Handles large JSON documents efficiently

🧪 Quality Assurance

  • ✅ 36 Tests Passing: Comprehensive unit test coverage
  • 🔬 Benchmarked: Performance testing with BenchmarkDotNet
  • 📋 Validated: Real-world scenarios and edge cases covered
  • 🛡️ Type Safe: Full nullable reference type support

🎯 Use Cases

  • API Data Transformation: Convert between different API formats
  • Data Migration: Transform data during system migrations
  • Report Generation: Aggregate and reshape data for reporting
  • Configuration Mapping: Transform configuration files
  • Event Processing: Transform event data for different consumers
  • ETL Pipelines: Extract, transform, and load operations

🛠️ Technical Details

Target Framework

  • .NET 9.0

Dependencies

  • System.Text.Json (built-in)
  • JsonPath.Net 1.0.5

API Surface

// Primary transformation methods
public string Transform(string sourceJson, string templateJson)
public async Task<string> TransformAsync(string sourceJson, string templateJson)

// Strongly-typed overloads
public T Transform<T>(string sourceJson, TransformationTemplate template)
public async Task<T> TransformAsync<T>(string sourceJson, TransformationTemplate template)

⚠️ Alpha Release Warning

This is an experimental alpha version for testing and feedback purposes. Not recommended for production use.

📄 License

MIT License - see LICENSE for details.


Built with ❤️ by NextGenPowerToys

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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
2.3.0 189 7/16/2025 2.3.0 is deprecated.

Version 2.3.0 - String Operations Release! NEW FEATURES: String Operations - Advanced string comparison operators (contains, startsWith, endsWith) integrated with conditional logic and aggregation filters, Enhanced template engine with string operators in JSONPath expressions, Complex employee processing examples with email filtering and badge generation. EXAMPLES: Interactive playground updated with sophisticated string operations examples, Console examples enhanced with 3 string operation sub-scenarios, API documentation with new "String Operations" transformation service. TESTING: 36 test cases with 100% pass rate (added 10 string operations tests), Production scenarios including email validation and file processing, Enhanced test coverage for string comparison operations. DOCUMENTATION: Complete query templates reference (query-templates.md) included in package, Updated README with all functionality and comprehensive examples, Full documentation coverage for all transformation capabilities. Ready for production use with complete string processing capabilities.