Albatross.Json 1.0.0

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

Albatross.Json

Extension methods for System.Text.Json and JsonNode objects.

Installation

dotnet add package Albatross.Json

Features

  • SetValue - Set values at any path within a JSON structure
  • Case-Sensitive/Insensitive - Control property matching via JsonSerializerOptions
  • Auto Path Creation - Intermediate objects created automatically
  • Array Support - Navigate arrays using numeric string indices

SetValue Method

public static JsonNode? SetValue<T>(this JsonNode? node, string[] path, T? value, JsonSerializerOptions options)

Case Sensitivity

Case-Insensitive - Matches properties regardless of case, preserves original casing:

var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
var node = JsonNode.Parse("""{"UserName":"old"}""");
node = node.SetValue(["username"], "new", options);
// Result: {"UserName":"new"}

Case-Sensitive (default) - Different casing creates separate properties:

var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = false };
var node = JsonNode.Parse("""{"Name":"old"}""");
node = node.SetValue(["name"], "new", options);
// Result: {"Name":"old","name":"new"}

Examples

using Albatross.Json;
using System.Text.Json;
using System.Text.Json.Nodes;

var options = new JsonSerializerOptions();

// Set nested property
var node = JsonNode.Parse("{}");
node = node.SetValue(["level1", "level2"], "value", options);
// Result: {"level1":{"level2":"value"}}

// Update array element
node = JsonNode.Parse("""{"arr":[1,2,3]}""");
node = node.SetValue(["arr", "1"], 99, options);
// Result: {"arr":[1,99,3]}

// Set property inside array element
node = JsonNode.Parse("""{"items":[{"id":1}]}""");
node = node.SetValue(["items", "0", "name"], "first", options);
// Result: {"items":[{"id":1,"name":"first"}]}

Documentation

Full documentation: https://rushuiguan.github.io/json/

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

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
1.0.0 99 9/13/2026
1.0.0-12.main 60 5/11/2026
1.0.0-9.main 49 3/26/2026