JSONPathPredicate 1.1.0

Suggested Alternatives

JSONPredicate

Additional Details

Maintaining this library under new name. Please use JSONPredicate for continued updates.

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package JSONPathPredicate --version 1.1.0
                    
NuGet\Install-Package JSONPathPredicate -Version 1.1.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="JSONPathPredicate" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JSONPathPredicate" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="JSONPathPredicate" />
                    
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 JSONPathPredicate --version 1.1.0
                    
#r "nuget: JSONPathPredicate, 1.1.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 JSONPathPredicate@1.1.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=JSONPathPredicate&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=JSONPathPredicate&version=1.1.0
                    
Install as a Cake Tool

NuGet version License: MIT GitHub Release master-build master-codeql .Net 9.0 .Net Framework 4.6.4 .Net Standard 2.0

A powerful .NET library for evaluating string-based predicate expressions against JSON objects using JSONPath syntax.

Features

  • JSONPath Support: Access nested object properties using dot notation
  • Multiple Operators: eq (equal), in (contains), not (not equal), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal)
  • Logical Operators: and, or with proper precedence handling
  • Type Safety: Automatic type conversion and validation
  • Complex Expressions: Parentheses grouping and nested operations
  • Lightweight: Minimal dependencies, fast evaluation

Installation

Install via NuGet Package Manager:

Install-Package JsonPathPredicate

Getting Started

The library provides a powerful, flexible way to evaluate complex conditional logic against JSON objects, making it ideal for business rules, filtering, validation, and many other use cases in .NET applications.

Please see wiki for comprehensive documentation to integrate JSONPathPredicate in your project.

i. Expression Syntax

The expression syntax is ([JSONPath] [Comparison Operator] [Value]) [Logical Operator] ([JSONPath] [Comparison Operator] [Value])

ii. Supported Operators
  • Comparison Operators - eq, in, gt, gte, lt, lte & Not
  • Logical Operators - and & or

Example

var customer = new {
    client = new {
        address = new {
            postcode = "e113et",
            number = 123,
            active = true
        },
        tags = new[] { "vip", "premium" }
    },
    score = 95.5
};
i. Simple equality
bool result1 = JSONPredicate.Evaluate("client.address.postcode eq `e113et`", customer);
ii. Logical operators
bool result2 = JSONPredicate.Evaluate("client.address.postcode eq `e113et` and client.address.number eq 123", customer);
iii. Array operations
bool result3 = JSONPredicate.Evaluate("client.tags in [`vip`, `standard`]", customer);

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the license file for details.

Support

  • 📖 Read the Documentation
  • 🐛 If you are having problems, please let us know by raising a new issue here.
  • 💬 Ask questions on Discussions
Product 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 was computed.  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 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. 
.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 is compatible.  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

v1.1.0 - Fixed Thread-Safety and Null comparisons.