Soenneker.Json.OptionsCollection 11.0.1321

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Json.OptionsCollection --version 11.0.1321
                    
NuGet\Install-Package Soenneker.Json.OptionsCollection -Version 11.0.1321
                    
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="Soenneker.Json.OptionsCollection" Version="11.0.1321" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Json.OptionsCollection" Version="11.0.1321" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Json.OptionsCollection" />
                    
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 Soenneker.Json.OptionsCollection --version 11.0.1321
                    
#r "nuget: Soenneker.Json.OptionsCollection, 11.0.1321"
                    
#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 Soenneker.Json.OptionsCollection@11.0.1321
                    
#: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=Soenneker.Json.OptionsCollection&version=11.0.1321
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Json.OptionsCollection&version=11.0.1321
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Json.OptionsCollection

Common serializer profiles for System.Text.Json.

Install

dotnet add package Soenneker.Json.OptionsCollection

System.Text.Json profiles

using System.Text.Json;
using Soenneker.Json.OptionsCollection;

string apiJson = JsonSerializer.Serialize(
    response,
    JsonOptionsCollection.WebOptions);

string readableJson = JsonSerializer.Serialize(
    response,
    JsonOptionsCollection.PrettySafeOptions);
Profile Naming/defaults Indented Enum strings Comment reads Encoder
GeneralOptions General No No Skip Default
WebOptions Web No Yes Skip Default
PrettyOptions General Yes Yes Disallow Relaxed
PrettySafeOptions General Yes Yes Disallow Default

All four profiles omit null properties and are shared, read-only instances. Clone one before customization:

var custom = new JsonSerializerOptions(
    JsonOptionsCollection.WebOptions)
{
    WriteIndented = true
};

PrettyOptions uses UnsafeRelaxedJsonEscaping, which leaves characters such as <, >, and & less escaped. Do not embed its output directly into HTML or a script context. Use PrettySafeOptions when output crosses a trust boundary.

Select a profile by JsonOptionType

JsonSerializerOptions options =
    JsonOptionsCollection.GetOptionsFromType(optionType);

GeneralValue, PrettyValue, and PrettySafeValue select their matching profiles. A null or unrecognized value falls back to WebOptions.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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 Soenneker.Json.OptionsCollection:

Package Downloads
Soenneker.Utils.Json

Serializes, deserializes, validates, formats, and writes JSON with System.Text.Json.

Soenneker.Cosmos.Serializer

A fast, lightweight JSON (de)serializer for Azure Cosmos DB

Soenneker.Extensions.JsonElements

A collection of helpful JsonElement extension methods

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1326 908 12/1/2026
11.0.1325 2,030 11/30/2026
11.0.1324 51 11/30/2026
11.0.1323 9,452 11/29/2026
11.0.1322 25,960 11/18/2026
11.0.1321 100 11/18/2026
11.0.1320 23,348 11/14/2026
11.0.1319 19,221 11/11/2026
11.0.1318 100 11/11/2026
11.0.1317 2,140 11/11/2026
11.0.1316 68,960 10/26/2026
11.0.1315 2,097 10/26/2026
4.0.1314 29,694 10/15/2026
4.0.1313 240 10/14/2026
4.0.1312 1,124 10/14/2026
4.0.1310 5,767 10/14/2026
4.0.1309 1,348 10/14/2026
4.0.1308 128 10/14/2026
4.0.1302 1,623 10/13/2026
4.0.1301 3,798 10/12/2026
Loading failed

Configure .NET CI defaults and daily source scans