Sparkdo.Json.Abstractions 2.0.0-preview.2

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

Sparkdo.Json.Abstractions

Sparkdo.Json.Abstractions 定义 Sparkdo Json 的 context 标记、序列化入口和 options 配置契约。

职责

  • [SparkdoJsonContext] 标记参与 compile-time aggregation 的 JsonSerializerContext
  • 通过 attribute 的 NamePriority 声明命名 options 和 resolver 顺序。
  • 定义同步、Type 和 stream 异步序列化入口 IJsonSerializer
  • SparkdoJsonSerializerOptions 配置 default 或 named JsonSerializerOptions
  • JsonCapability.Id 暴露稳定 capability id Sparkdo.Json

非职责

  • 不发现 context,不生成 resolver 或 bootstrap source。
  • 不创建 DI service 或运行 serializer。
  • 不扫描程序集,也不提供 reflection fallback。

使用

using System.Text.Json.Serialization;
using Sparkdo.Json;

[SparkdoJsonContext]
[JsonSerializable(typeof(Order))]
internal partial class ApplicationJsonContext : JsonSerializerContext;

[SparkdoJsonContext("messaging", Priority = 20)]
[JsonSerializable(typeof(OrderMessage))]
internal partial class MessagingJsonContext : JsonSerializerContext;

options name 必须匹配 [A-Za-z0-9._-]+,因此可直接使用稳定 package id。无参 attribute 使用 default

依赖

项目面向 netstandard2.0,依赖 System.Text.JsonSystem.Threading.Tasks.Extensions

验证

dotnet test src/json/test/Sparkdo.Json.Tests/Sparkdo.Json.Tests.csproj --no-restore -p:UseSharedCompilation=false -nr:false
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 was computed.  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 was computed. 
.NET Framework net461 was computed.  net462 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on Sparkdo.Json.Abstractions:

Package Downloads
Sparkdo.Json

Sparkdo Json 的 source-generated 序列化运行时与 manifest 约定。

Sparkdo.Json.SystemTextJson

Sparkdo SystemTextJson模块,提供基于System.Text.Json的JSON序列化和反序列化功能,支持自定义转换器、日期时间标准化处理、枚举序列化、扩展属性序列化等特性。

Sparkdo.Json.Newtonsoft

Sparkdo Newtonsoft.Json模块,提供基于Newtonsoft.Json的JSON序列化和反序列化功能,支持自定义转换器、日期时间标准化处理等特性。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.2 85 7/20/2026
2.0.0-preview.1 73 7/18/2026
1.0.4-preview.3 305 6/8/2026
1.0.4-preview.2 288 6/7/2026
1.0.4-preview.1 264 6/7/2026
1.0.3 632 6/6/2026
1.0.3-preview.1 273 5/17/2026
1.0.2 513 4/27/2026
1.0.2-preview.5 131 4/15/2026
1.0.2-preview.4 149 2/8/2026
1.0.2-preview.3 141 2/1/2026
1.0.2-preview.2 153 1/31/2026
1.0.2-preview.1 218 12/4/2025
1.0.1 1,351 11/27/2025
1.0.0 1,283 11/25/2025
1.0.0-preview.5 157 10/24/2025