NextGenPowerToys.Json.Transform.Test
2.3.0
NextGenPowerToys.Json.Transform
Additional Detailswrong package name
dotnet add package NextGenPowerToys.Json.Transform.Test --version 2.3.0
NuGet\Install-Package NextGenPowerToys.Json.Transform.Test -Version 2.3.0
<PackageReference Include="NextGenPowerToys.Json.Transform.Test" Version="2.3.0" />
<PackageVersion Include="NextGenPowerToys.Json.Transform.Test" Version="2.3.0" />
<PackageReference Include="NextGenPowerToys.Json.Transform.Test" />
paket add NextGenPowerToys.Json.Transform.Test --version 2.3.0
#r "nuget: NextGenPowerToys.Json.Transform.Test, 2.3.0"
#:package NextGenPowerToys.Json.Transform.Test@2.3.0
#addin nuget:?package=NextGenPowerToys.Json.Transform.Test&version=2.3.0
#tool nuget:?package=NextGenPowerToys.Json.Transform.Test&version=2.3.0
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
- GitHub Repository: https://github.com/NextGenPowerToys/dotnet-json-transform
- Interactive Examples: Live playground with 9 transformation scenarios
- API Documentation: Complete Swagger documentation
- Performance Benchmarks: Detailed performance analysis
⚡ 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 | Versions 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. |
-
net9.0
- JsonPath.Net (>= 1.0.5)
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 |
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.