Iyume.JsonPath 0.1.0

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

Iyume.JsonPath

NuGet

JsonPath compile-time weaving for .NET 10 via C# 14 Interceptors and Incremental Source Generators. Zero runtime parsing overhead for literal paths — the source generator rewrites your JsonPath strings to hard-coded extension method chains at compile time.

Features

  • Compile-time literal interception — JsonPath.Select(root, "$.store.book[*].title") is rewritten by the compiler into direct method calls, no parsing at runtime
  • Partial method code-gen — [JsonPath(typeof(JsonNode), "$..author")] on a partial method generates the body
  • Runtime interpreter — for paths from external input (config, user input, network)
  • RFC 9535 compliant parser with full filter expression support
  • Supports:
    • System.Text.Json.Nodes.JsonNode
    • System.Text.Json.JsonElement
    • Newtonsoft.Json.Linq.JToken (via optional Iyume.JsonPath.Newtonsoft package)

Installation

# Core package (System.Text.Json support)
dotnet add package Iyume.JsonPath

# Optional: Newtonsoft.Json support
dotnet add package Iyume.JsonPath.Newtonsoft

Interceptor setup

To use JsonPath.Select() with string literals, add the interceptor namespace to your .csproj:

<InterceptorsNamespaces>$(InterceptorsNamespaces);Iyume.JsonPath.Compiler.Generated</InterceptorsNamespaces>

Quick Start

1. Compile-time: Interceptor (JsonPath.Select)

using System.Text.Json.Nodes;
using Iyume.JsonPath.Compiler;

var root = JsonNode.Parse(jsonString);
// The string literal "$.store.book[*].title" is intercepted at compile time
// and replaced with generated extension method calls — zero parsing overhead.
var titles = JsonPath.Select(root, "$.store.book[*].title");

2. Compile-time: Partial Method ([JsonPath])

using System.Text.Json.Nodes;
using Iyume.JsonPath.Compiler;

[JsonPath(typeof(JsonNode), "$.store.book[?(@.price < 10)].title")]
public static partial IEnumerable<JsonNode?> GetCheapBookTitles(JsonNode root);

3. Runtime: Interpreter

using System.Text.Json.Nodes;
using Iyume.JsonPath.Interpreter;

var root = JsonNode.Parse(jsonString);
// For paths from external input — pre-parse once for repeated queries
var ast = JsonPathParser.Parse("$.store.book[*].author");
var authors = JsonPathInterpreter.Evaluate(root, ast);

Supported JsonPath Syntax

Syntax Example Description
Root $ Root node
Dot notation $.store.book Child access
Bracket notation $['store']['book'] Child access with quotes
Wildcard $.store.book[*] or $.* All children
Index $.store.book[0] or $.store.book[-1] Array index (negative supported)
Slice $.store.book[0:2] or $.store.book[0:10:2] Array slice with optional step
Descendant $..author or $..* Recursive descent
Multiple selectors $['store','warehouse'] Comma-separated names
Filter — exists $.store.book[?@.isbn] Property existence check
Filter — comparison $.store.book[?(@.price < 10)] Value comparison (<, >, <=, >=, ==, !=)
Filter — logical $.store.book[?(@.price < 15 && @.category == 'fiction')] &&, ||, !
Filter — functions $.store.book[?length(@.author) > 10] length(), count()

Build

# Build
dotnet build Iyume.JsonPath.slnx

# Run tests
dotnet test tests/Iyume.JsonPath.Tests.csproj

# Run benchmarks
dotnet run -c Release --project benchmarks/Iyume.JsonPath.Benchmarks/Iyume.JsonPath.Benchmarks.csproj

Requirements

  • .NET 10 (net10.0)
  • C# 14

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Iyume.JsonPath:

Package Downloads
Iyume.JsonPath.Newtonsoft

Newtonsoft.Json (JToken) support for Iyume.JsonPath — navigation extensions and runtime interpreter. Install this package alongside Iyume.JsonPath only if you work with Newtonsoft.Json.Linq types.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 142 7/9/2026