JsonEvalRs 0.0.96

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

JsonEvalRs - C# Bindings

High-performance JSON Logic evaluator with schema validation and dependency tracking for .NET applications.

Features

  • 🚀 Blazing Fast - Built on Rust for maximum performance
  • Schema Validation - Validate data against JSON schema rules
  • 🔄 Dependency Tracking - Auto-update dependent fields
  • 🎯 Type Safe - Full .NET type safety with JSON.NET integration
  • 📦 Cross-Platform - Works on Windows, Linux, and macOS
  • 🔌 Easy Integration - Simple API, just a few lines of code

Installation

dotnet add package JsonEvalRs

Or via NuGet Package Manager:

Install-Package JsonEvalRs

Quick Start

using JsonEvalRs;
using Newtonsoft.Json.Linq;

// Create evaluator with schema
string schema = @"{
    ""type"": ""object"",
    ""properties"": {
        ""user"": {
            ""type"": ""object"",
            ""properties"": {
                ""name"": {
                    ""type"": ""string"",
                    ""rules"": {
                        ""required"": { ""value"": true, ""message"": ""Name is required"" },
                        ""minLength"": { ""value"": 3, ""message"": ""Min 3 characters"" }
                    }
                },
                ""age"": {
                    ""type"": ""number"",
                    ""rules"": {
                        ""minValue"": { ""value"": 18, ""message"": ""Must be 18+"" }
                    }
                }
            }
        }
    }
}";

using (var eval = new JSONEval(schema))
{
    // Evaluate
    string data = @"{ ""user"": { ""name"": ""John"", ""age"": 25 } }";
    JObject result = eval.Evaluate(data);
    Console.WriteLine($"Evaluated: {result}");

    // Validate
    ValidationResult validation = eval.Validate(data);
    if (validation.HasError)
    {
        foreach (var error in validation.Errors)
        {
            Console.WriteLine($"{error.Path}: {error.Message}");
        }
    }

    // Re-evaluate after changes
    string updatedData = @"{ ""user"": { ""name"": ""John"", ""age"": 30 } }";
    JObject updated = eval.EvaluateDependents(
        new List<string> { "user.age" },
        updatedData,
        nested: true
    );
}

API Reference

JSONEval Constructor

public JSONEval(string schema, string context = null, string data = null)

Creates a new evaluator instance.

Parameters:

  • schema (string): JSON schema definition
  • context (string, optional): Context data for evaluations
  • data (string, optional): Initial data

Evaluate Method

public JObject Evaluate(string data, string context = null)

Evaluates the schema with provided data.

Parameters:

  • data (string): JSON data to evaluate
  • context (string, optional): Context data

Returns: JObject with evaluated schema

Validate Method

public ValidationResult Validate(string data, string context = null)

Validates data against schema rules.

Parameters:

  • data (string): JSON data to validate
  • context (string, optional): Context data

Returns: ValidationResult with errors (if any)

EvaluateDependents Method

public JObject EvaluateDependents(
    List<string> changedPaths, 
    string data, 
    string context = null, 
    bool nested = true
)

Re-evaluates fields that depend on changed paths.

Parameters:

  • changedPaths (List<string>): Paths that changed
  • data (string): Updated data
  • context (string, optional): Context data
  • nested (bool): Follow dependency chains recursively

Returns: JObject with updated evaluated schema

Validation Rules

Supported validation rules:

  • required - Field must have a value
  • minLength / maxLength - String/array length validation
  • minValue / maxValue - Numeric range validation
  • pattern - Regex pattern matching

Platform Support

  • .NET Standard 2.0+ - Compatible with .NET Framework 4.6.1+
  • .NET 6/7/8 - Latest .NET versions
  • Windows - x64
  • Linux - x64
  • macOS - x64, ARM64

Performance

Typical performance characteristics:

  • Schema parsing: < 5ms
  • Evaluation: < 10ms for complex schemas
  • Validation: < 5ms

Error Handling

All methods throw JsonEvalException on errors:

try
{
    var result = eval.Evaluate(data);
}
catch (JsonEvalException ex)
{
    Console.WriteLine($"Evaluation error: {ex.Message}");
}

Memory Management

JSONEval implements IDisposable. Always dispose instances:

using (var eval = new JSONEval(schema))
{
    // Use eval
} // Automatically disposed

// Or manually
var eval = new JSONEval(schema);
try
{
    // Use eval
}
finally
{
    eval.Dispose();
}

License

MIT License

Support

Version

string version = JSONEval.Version;
Console.WriteLine($"JsonEvalRs version: {version}");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 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. 
.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 is compatible. 
.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. 
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
0.0.96 90 5/6/2026
0.0.95 92 5/6/2026
0.0.94 80 5/5/2026
0.0.93 89 5/5/2026
0.0.92 80 5/5/2026
0.0.91 84 5/5/2026
0.0.90 88 5/4/2026
0.0.89 83 5/4/2026
0.0.88 85 5/3/2026
0.0.87 112 4/27/2026
0.0.86 114 4/13/2026
0.0.85 103 4/12/2026
0.0.84 108 4/5/2026
0.0.83 102 4/5/2026
0.0.82 112 4/4/2026
0.0.81 111 4/1/2026
0.0.80 106 3/31/2026
0.0.79 103 3/31/2026
0.0.78 102 3/31/2026
0.0.77 101 3/31/2026
Loading failed