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
<PackageReference Include="Jakar.Json.SystemTextJson" Version="10.1.0" />
<PackageVersion Include="Jakar.Json.SystemTextJson" Version="10.1.0" />
<PackageReference Include="Jakar.Json.SystemTextJson" />
paket add Jakar.Json.SystemTextJson --version 10.1.0
#r "nuget: Jakar.Json.SystemTextJson, 10.1.0"
#:package Jakar.Json.SystemTextJson@10.1.0
#addin nuget:?package=Jakar.Json.SystemTextJson&version=10.1.0
#tool nuget:?package=Jakar.Json.SystemTextJson&version=10.1.0
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
Utf8JsonWriteras 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 | Versions 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. |
-
net10.0
- Jakar.Json (>= 10.1.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on Jakar.Json.SystemTextJson:
| Package | Downloads |
|---|---|
|
Jakar.Json.MassTransit
Jakar.Json for MassTransit: messages of [JsonModel] types are written and read by Jakar.Json inside MassTransit's JSON envelope (the System.Text.Json serializer, configured with Jakar.Json.SystemTextJson). |
|
|
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.Marten
Jakar.Json for Marten (PostgreSQL document database and event store): documents and events of [JsonModel] types are written and read by Jakar.Json through Marten's System.Text.Json serializer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.0 | 84 | 10/18/2026 |
10.1.0: initial release.