Jakar.Json.SystemTextJson 10.1.0

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

Jakar.Json.SystemTextJson

Runs Jakar.Json inside System.Text.Json. [JsonModel] types, and arrays, lists and collection interfaces of them, are read and written by Jakar.Json. Every other type keeps System.Text.Json's handling.

JsonSerializerOptions options = new JsonSerializerOptions(JsonSerializerDefaults.Web).AddJakarJson();

This reaches every framework you configure through JsonSerializerOptions, with no package of its own:

Host Where the options go
ASP.NET Core minimal APIs / MVC (System.Text.Json) ConfigureHttpJsonOptions(o => o.SerializerOptions.AddJakarJson()), AddJsonOptions(o => o.JsonSerializerOptions.AddJakarJson())
SignalR JSON protocol AddJsonProtocol(o => o.PayloadSerializerOptions.AddJakarJson())
HttpClient (System.Net.Http.Json) GetFromJsonAsync<T>(url, options), PostAsJsonAsync(url, value, options)
Microsoft.Extensions.AI AIFunctionFactory.Create(..., serializerOptions: options), AIJsonUtilities
Npgsql json/jsonb dataSourceBuilder.ConfigureJsonOptions(options)
Dapr new DaprClientBuilder().UseJsonSerializationOptions(options)
Refit, RestSharp, Flurl (System.Text.Json mode) their System.Text.Json serializer's options
Google Cloud Functions, gRPC JSON transcoding, HotChocolate their JsonSerializerOptions

How it works

JakarJsonConverterFactory hands System.Text.Json a JakarJsonConverter<T> for each model type:

  • Writing: Jakar.Json writes the value into a pooled buffer, which is copied into the Utf8JsonWriter as is. The model keeps its own [JsonModel] naming, spacing and indentation.
  • Reading: System.Text.Json buffers the whole value before it calls a converter. The converter takes the value's raw UTF-8 and Jakar.Json parses it.

The bridge costs one copy each way, plus System.Text.Json scanning the value to find where it ends. The model's own reading and writing still run on Jakar.Json. When the host lets you hand it bytes directly, a dedicated integration avoids the bridge: ASP.NET Core, HttpClient, caching, messaging and so on.

Native AOT

System.Text.Json needs one converter instance per type. Normally the factory creates them on demand. Under Native AOT, list the types it converts instead:

options.AddJakarJson(f => f.Add<Order>().Add<List<Order>>());

You can also add new JakarJsonConverter<Order>() to options.Converters yourself. This works alongside a source-generated JsonSerializerContext.

Errors

Malformed JSON throws JsonReadException, which derives from System.Text.Json's JsonException, so hosts report it the way they report their own errors. JSON null reads as null for reference types, and throws JsonException for a struct model.

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.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Jakar.Json.SystemTextJson:

Package Downloads
Jakar.Json.SignalR

Jakar.Json for SignalR's JSON hub protocol: hub method arguments and results of [JsonModel] types are written and read by Jakar.Json, on servers and .NET clients alike.

Jakar.Json.GraphQLClient

Jakar.Json for GraphQL.Client: response data (and variables) of [JsonModel] types are read and written by Jakar.Json through the client's System.Text.Json serializer, over HTTP and WebSockets.

Jakar.Json.Rebus

Jakar.Json for Rebus: message bodies of [JsonModel] types are written and read by Jakar.Json inside Rebus' System.Text.Json serializer (configured with Jakar.Json.SystemTextJson).

Jakar.Json.NServiceBus

Jakar.Json for NServiceBus: messages of [JsonModel] types are written and read by Jakar.Json through NServiceBus' System.Text.Json serializer.

Jakar.Json.Orleans

Jakar.Json for Orleans: grain call arguments, results and state of [JsonModel] types are serialized by Jakar.Json inside Orleans' serializer (its System.Text.Json codec, for exactly the types Jakar.Json supports).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.1.0 71 10/18/2026

10.1.0: initial release.